Class: PubSubService
#
Constructors#
constructor• Private
new PubSubService()
#
Defined in#
Properties#
server• Private
Optional
server: Server
#
Defined in#
clientâ–ª Static
Protected
client: PubSubClientV2
#
Defined in#
driverâ–ª Static
Protected
driver: "synchronous"
| "google"
#
Defined in#
instanceâ–ª Static
Protected
instance: PubSubService
#
Defined in#
statusâ–ª Static
Private
status: "ready"
| "pending"
| "closed"
= 'pending'
#
Defined in#
Methods#
bindâ–¸ Private
bind(instance
): void
#
ParametersName | Type |
---|---|
instance | PubSubService |
#
Returnsvoid
#
Defined in#
closeAllâ–¸ closeAll(): Promise
<void
>
#
ReturnsPromise
<void
>
#
Defined in#
getAllSubscriptionsâ–¸ getAllSubscriptions(): Promise
<AllSubscriptions
[]>
Retrieves a list of subscribers
#
ReturnsPromise
<AllSubscriptions
[]>
#
Defined in#
getClientâ–¸ Private
getClient(): PubSubClientV2
#
ReturnsPubSubClientV2
#
Defined in#
getSubscribersâ–¸ getSubscribers(): Subscribers
#
ReturnsSubscribers
#
Defined in#
initClientâ–¸ initClient(): void
#
Returnsvoid
#
Defined in#
initDriverâ–¸ Private
initDriver(): void
#
Returnsvoid
#
Defined in#
publishâ–¸ publish<T
, P
>(topic
, message
, options
): Promise
<string
>
Publishes new orders to PubSub.
#
Type parametersName | Type |
---|---|
T | extends Topic <T > |
P | extends Payload |
#
ParametersName | Type |
---|---|
topic | T |
message | P |
options | PublishOptions |
#
ReturnsPromise
<string
>
#
Defined in#
shouldStartSynchronousSubscriptionsâ–¸ Private
shouldStartSynchronousSubscriptions(): boolean
#
Returnsboolean
#
Defined in#
startServerâ–¸ Private
startServer(): void
#
Returnsvoid
#
Defined in#
startSubscriptionsâ–¸ startSubscriptions(): Promise
<void
>
#
ReturnsPromise
<void
>
#
Defined in#
subscribeâ–¸ subscribe(subscription
): Promise
<void
>
Subscribes to any given topic
#
ParametersName | Type |
---|---|
subscription | SubscriberTuple |
#
ReturnsPromise
<void
>
#
Defined in#
syncDriverIsEnabledâ–¸ Private
syncDriverIsEnabled(): boolean
#
Returnsboolean
#
Defined in#
validateâ–¸ Protected
validate<T
, P
>(topic
, message
): void
Validates Topic and Message according to validation rules set in Topic class
#
Type parametersName | Type |
---|---|
T | extends Topic <T > |
P | extends Payload |
#
ParametersName | Type | Description |
---|---|---|
topic | T | Topic |
message | P | Message |
#
Returnsvoid
#
Defined in#
getInstanceâ–¸ Static
getInstance(): PubSubService
#
Returns#
Defined in#
isHealthyâ–¸ Static
isHealthy(): boolean
#
Returnsboolean