- Source:
Members
member
events
Get the event handlers for this publisher.
- Source:
member
events
Set the event handlers for this publisher.
- Source:
member
subscriptionCount
Get the number of subscriptions to this publisher.
- Source:
member
topic :string
Type:
- string
- Source:
Methods
function
publish(message) → {undefined}
Publish a message
Parameters:
| Name | Type | Description |
|---|---|---|
message |
object | Buffer | The message to be sent, could be kind of JavaScript message generated from .msg or be a Buffer for a raw message. |
- Source:
Returns:
Type
undefined
function
waitForAllAcked(timeout) → {boolean}
Wait until all published message data is acknowledged or until the specified timeout elapses
If the timeout is negative then this function will block indefinitely until all published
message data is acknowledged.
If the timeout is 0 then it will check if all published message has been acknowledged without
waiting.
If the timeout is greater than 0 then it will return after that period of time has elapsed or
all published message data is acknowledged.
Raises an error if failed, such as the middleware not supporting this feature.
Parameters:
| Name | Type | Description |
|---|---|---|
timeout |
timeout | The duration to wait for all published message data to be acknowledged in nanoseconds. |
- Source:
Returns:
`true` if all published message data is acknowledged before the timeout, otherwise `false`.
Type
boolean