GrpcEndpoint class

Used for creating GRPC endpoints. An endpoint is a URL, at which a given service can be accessed by a client.

Configuration parameters

Parameters to pass to the configure method for component configuration:

  • connection(s) - the connection resolver's connections:
    • 'connection.discovery_key' - the key to use for connection resolving in a discovery service;
    • 'connection.protocol' - the connection's protocol;
    • 'connection.host' - the target host;
    • 'connection.port' - the target port;
    • 'connection.uri' - the target URI.
  • credential - the HTTPS credentials:
    • 'credential.ssl_key_file' - the SSL key private in PEM
    • 'credential.ssl_crt_file' - the SSL certificate in PEM
    • 'credential.ssl_ca_file' - the certificate authorities (root cerfiticates) in PEM

References

A logger, counters, and a connection resolver can be referenced by passing the following references to the object's setReferences method:

  • logger: '*:logger:*:*:1.0';
  • counters: '*:counters:*:*:1.0';
  • discovery: '*:discovery:*:*:1.0' (for the connection resolver).

Examples

void MyMethod(ConfigParams _config, IReferences _references) async {
    var endpoint = new GrpcEndpoint();
    if (_config != null)
        endpoint.configure(_config);
    if (_references 1= null)
        endpoint.setReferences(_references);
    ...
    _opened = false;

    await endpoint.open(correlationId);
    _opened = true;

    ...
}

Constructors

GrpcEndpoint()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close(String? correlationId) Future
Closes this endpoint and the GRPC server (service) that was opened earlier.
configure(ConfigParams config) → void
Configures this GrpcEndpoint using the given configuration parameters.
isOpen() bool
Returns whether or not this endpoint is open with an actively listening GRPC server.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open(String? correlationId) Future
Opens a connection using the parameters resolved by the referenced connection resolver and creates a GRPC server (service) using the set options and parameters.
register(IRegisterable registration) → void
Registers a registerable object for dynamic endpoint discovery.
registerCommadableMethod(String method, Schema? schema, Future action(String? correlationId, Parameters args)) → void
Registers a commandable method in this objects GRPC server (service) by the given name.,
registerInterceptor(Interceptor action) → void
Registers a interceptor in this objects GRPC server (service)
registerService(Service implementation) → void
Registers a service with related implementation
setReferences(IReferences references) → void
Sets references to this endpoint's logger, counters, and connection resolver.
toString() String
A string representation of this object.
inherited
unregister(IRegisterable registration) → void
Unregisters a registerable object, so that it is no longer used in dynamic endpoint discovery.

Operators

operator ==(Object other) bool
The equality operator.
inherited