Creates a new instance of the client.
a service role (name).
Calls a remote method via HTTP/REST protocol.
a service role (service name)
a command name
(optional) transaction id to trace execution through call chain.
(optional) command parameters.
(optional) callback function that receives result object or error.
Calls a remote method via Seneca commadable protocol.
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 Timing object that is used to end the time measurement.
(optional) transaction id to trace execution through call chain.
a method name.
Timing object to end the time measurement.
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.
Resolves and validates connection to Seneca service.
(optional) transaction id to trace execution through call chain.
callback function that receives connection parameters or error.
Sets references to dependent components.
references to locate the component dependencies.
Generated using TypeDoc
Abstract client that calls commandable Seneca service.
Commandable services are generated automatically for ICommandable objects. Each command is exposed as Seneca action.
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 MyCommandableSenecaClient extends CommandableSenecaClient 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 MyCommandableSenecaClient(); client.configure(ConfigParams.fromTuples( "connection.protocol", "http", "connection.host", "localhost", "connection.port", 8080 )); client.getData("123", "1", (err, result) => { ... });