Cancels a timeout associated with the subscription
Draining a subscription is similar to unsubscribe but inbound pending messages are not discarded. When the last in-flight message is processed, the subscription handler is removed.
a Promise that resolves when the draining a subscription completes
Returns the number of messages expected by the subscription.
If 0
, the subscription was not found or was auto-cancelled.
If -1
, the subscription didn't specify a count for expected messages.
Returns the number of messages received by the subscription.
Returns true if the subscription has an associated timeout.
true if the subscription is not found.
true if the subscription is draining.
Sets a timeout on a subscription. The timeout will fire by calling the subscription's callback with an error argument if the expected number of messages (specified via max) has not been received by the subscription before the timer expires. If max is not specified, the subscription times out if no messages are received within the timeout specified.
Returns true
if the subscription was found and the timeout was registered.
Cancels the subscription after the specified number of messages has been received. If max is not specified, the subscription cancels immediately. A cancelled subscription will not process messages that are inbound but not yet handled.
Generated using TypeDoc
Type returned when a subscribe call resolved. Provides methods to manage the subscription.