new Queue(opts, adapter)
- Source:
Optional queue plugin. Queues commands sent to transport and sends one at a time
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object | General settings for the Queue Properties
|
|||||||||
adapter |
Adapter | Adapter for which this is a plugin |
Methods
add(address, command, scopeopt) → {Promise}
- Source:
Adds a command to the queue. (Also processes next item from queue)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
address |
Object | String | undefined | The address of the device the command belongs to |
|
command |
Command | The command to send |
|
scope |
Object |
<optional> |
Context to use for the onReceived handler |
Returns:
- Type
- Promise
(private) process()
- Source:
Send next item from queue
(private) received(data) → {Boolean}
- Source:
Process received data from transport
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Buffer | The data received |
Returns:
True if queue handled the data
- Type
- Boolean