- Source:
Members
loggerName
Get the logger name for this client.
- Source:
serviceName :string
Type:
- string
- Source:
willValidateRequest :boolean
Whether requests will be validated before sending.
Type:
- boolean
- Source:
willValidateRequest
Enable or disable request validation for this client.
- Source:
Methods
configureIntrospection(clock, qos, introspectionState)
Configure introspection.
Parameters:
| Name | Type | Description |
|---|---|---|
clock |
Clock | Clock to use for service event timestamps |
qos |
QoS | QoSProfile for the service event publisher |
introspectionState |
ServiceIntrospectionState | State to set introspection to |
- Source:
isServiceServerAvailable() → {boolean}
Checks if the service is available.
- Source:
Returns:
true if the service is available.
- Type
- boolean
sendRequest(request, callback, optionsopt) → {undefined}
Send the request and will be notified asynchronously if receiving the response.
Parameters:
| Name | Type | Attributes | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
request |
object | The request to be submitted. | |||||||||
callback |
ResponseCallback | Thc callback function for receiving the server response. | |||||||||
options |
object |
<optional> |
Send options
Properties
|
- Source:
- See:
Throws:
-
If validation is enabled and request is invalid
Returns:
- Type
- undefined
sendRequestAsync(request, optionsopt) → {Promise.<object>}
Send the request and return a Promise that resolves with the response.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
object | The request to be submitted. | |||||||||||||||||
options |
object |
<optional> |
Optional parameters for the request.
Properties
|
- Source:
Throws:
-
-
If the request times out (when options.timeout is exceeded).
-
-
-
If the request is manually aborted (via options.signal).
-
-
-
If validation is enabled and request is invalid.
-
-
-
If the request fails for other reasons.
- Type
- Error
-
Returns:
Promise that resolves with the service response.
- Type
- Promise.<object>
setValidation(options)
Set validation options for this client.
Parameters:
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | Validation options
Properties
|
- Source:
(async) waitForService(timeout) → {Promise.<boolean>}
Wait until the service server is available or a timeout is reached. This
function polls for the service state so it may not return as soon as the
service is available.
Parameters:
| Name | Type | Description |
|---|---|---|
timeout |
number | The maximum amount of time to wait for, if timeout is `undefined` or `< 0`, this will wait indefinitely. |
- Source:
Returns:
true if the service is available.
- Type
- Promise.<boolean>