Clients -
nats :
Producer
NATS Producer
would act as a basic client allowing to publish messages to the NATS server.
Producer needs the NATS Connection
to be initialized.
Constructor
__init
(Connection connection)
- connection Connection
-
An already-established connection.
Remote Methods
publish
Produces a message to a NATS basic server for the given subject.
request
Produces a message and would wait for a response.
Methods
Produces a message to a NATS basic server for the given subject.
-
Return Type
(Error?) A specific error if there is a problem when publishing the message. Returns () otherwise.
Produces a message and would wait for a response.
Parameters
- subject string
-
Would represent the topic/queue name.
- data Content
-
The message body to publish.
- duration int - ()
-
The time to wait for a response measured in milliseconds.