Class: ClientMethodHandler
The MethodHandler which sends the commands to the Rust side.
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new ClientMethodHandler(options)
Parameters
| Name | Type | Description |
|---|---|---|
options | ClientMethodHandler | IClientOptions | client options or a client method handler. |
Properties
methodHandler
• methodHandler: ClientMethodHandler
Methods
destroy
▸ destroy(): Promise<any>
Returns
Promise<any>
callMethod
▸ callMethod(method): Promise<string>
Call a client method.
Parameters
| Name | Type | Description |
|---|---|---|
method | __ClientMethods__ | The client method. |
Returns
Promise<string>
A promise that resolves to a JSON string response holding the result of the client method.
listen
▸ listen(topics, callback): Promise<void>
Listen to MQTT events.
Parameters
| Name | Type | Description |
|---|---|---|
topics | string[] | The topics to listen to. |
callback | (error: Error, result: string) => void | The callback to be called when an MQTT event is received. |
Returns
Promise<void>