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
__detach
__gracefulStop
Gracefully stops the listener in the lifecycle.
__immediateStop
Forcefully stops the listener in the lifecycle.
LifeCycle Methods
Methods
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.