Creates a new instance of the client.
a service name.
The GRPC client.
The connection timeout in milliseconds.
The connection resolver.
The performance counters.
The logger.
The service name
The configuration options.
The invocation timeout in milliseconds.
The remote service uri which is calculated on open.
Calls a remote method via GRPC protocol.
a method name to called
(optional) transaction id to trace execution through call chain.
(optional) request object.
(optional) callback function that receives result object or error.
Calls a remote method via GRPC commadable protocol. The call is made via Invoke method and all parameters are sent in args object. The complete route to remote method is defined as serviceName + "." + name.
a name of the command to call.
(optional) transaction id to trace execution through call chain.
command parameters.
callback function that receives result or error.
Closes component and frees used resources.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Configures component by passing configuration parameters.
configuration parameters to be set.
Adds instrumentation to log calls and measure call time. It returns a CounterTiming object that is used to end the time measurement.
(optional) transaction id to trace execution through call chain.
a method name.
CounterTiming object to end the time measurement.
Adds instrumentation to error handling.
(optional) transaction id to trace execution through call chain.
a method name.
an occured error
(optional) an execution result
(optional) an execution callback
Checks if the component is opened.
true if the component has been opened and false otherwise.
Opens the component.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Sets references to dependent components.
references to locate the component dependencies.
Generated using TypeDoc
Abstract client that calls commandable GRPC service.
Commandable services are generated automatically for ICommandable objects. Each command is exposed as Invoke method that receives all parameters as args.
Configuration parameters
References
*:logger:*:*:1.0
(optional) ILogger components to pass log messages*:counters:*:*:1.0
(optional) ICounters components to pass collected measurements*:discovery:*:*:1.0
(optional) IDiscovery services to resolve connectionExample
class MyCommandableGrpcClient extends CommandableGrpcClient implements IMyClient { ... public getData(correlationId: string, id: string, callback: (err: any, result: MyData) => void): void { this.callCommand( "get_data", correlationId, { id: id }, (err, result) => { callback(err, result); } ); } ... } let client = new MyCommandableGrpcClient(); client.configure(ConfigParams.fromTuples( "connection.protocol", "http", "connection.host", "localhost", "connection.port", 8080 )); client.getData("123", "1", (err, result) => { ... });