Class: SubscriptionService
#
Constructors#
constructor• new SubscriptionService()
#
Defined insrc/service/subscription.ts:23
#
Properties#
defaultSubscriberOptionsâ–ª Static
defaultSubscriberOptions: SubscriberOptions
All subscriptions will inherit from this default options object
#
Defined insrc/service/subscription.ts:21
#
subscribersâ–ª Static
subscribers: SubscriberObject
<any
>[] = []
#
Defined insrc/service/subscription.ts:14
#
Methods#
closeAllâ–¸ Static
closeAll(): Promise
<void
>
Call this function from a process exit handler to close all current subscriptions
#
ReturnsPromise
<void
>
#
Defined insrc/service/subscription.ts:64
#
getSubscribersâ–¸ Static
getSubscribers(): Subscribers
#
ReturnsSubscribers
#
Defined insrc/service/subscription.ts:68
#
handleErrorâ–¸ Static
handleError(err
, metadata
): void
If passed, it would serve as the default error handler for all subscriptions. Applications should override this with custom error handling: log error, cleanup resources and exit the process. Default logs the error and rethrows
#
ParametersName | Type |
---|---|
err | Error |
metadata | SubscriberMetadata |
#
Returnsvoid
#
Defined insrc/service/subscription.ts:51
#
initâ–¸ Static
init(): Promise
<void
>
Can be used to initialize process level globals (like DB Connections). Default is a no-op
#
ReturnsPromise
<void
>
#
Defined insrc/service/subscription.ts:42
#
loadSubscriptionServiceâ–¸ Static
loadSubscriptionService(): typeof SubscriptionService
#
Returnstypeof SubscriptionService