Listener -
nats
: Listener
Represents a connection which will be used for subscription.
Constructor
__init
(Connection connection)
- connection Connection
-
An already-established connection or configuration to create a new connection.
Methods
Stops consuming messages and detaches the service from the Listener
endpoint.
Gracefully stops the listener in the lifecycle.
Forcefully stops the listener in the lifecycle.
LifeCycle Methods
Methods
Stops consuming messages and detaches the service from the Listener
endpoint.
Parameters
- s service
-
Type descriptor of the service
-
Return Type
(error?) Nil or error upon failure to detach the service
Gracefully stops the listener in the lifecycle.
-
Return Type
(error?) Error or ().
Forcefully stops the listener in the lifecycle.
-
Return Type
(error?) Error or ().
LifeCycle Methods
Binds the NATS consumer to a service.
Parameters
- s service
-
Type descriptor of the service.
- name string? (default ())
-
Name of the service.
-
Return Type
(error?) Returns nil or the error upon failure to register the listener.