Skip to main content
Version: v1

Class: PubSubService

Constructors#

constructor#

• Private new PubSubService()

Defined in#

src/service/pubsub.ts:18

Properties#

server#

• Private Optional server: Server

Defined in#

src/service/pubsub.ts:16


client#

â–ª Static Protected client: PubSubClientV2

Defined in#

src/service/pubsub.ts:12


driver#

â–ª Static Protected driver: "synchronous" | "google"

Defined in#

src/service/pubsub.ts:14


instance#

â–ª Static Protected instance: PubSubService

Defined in#

src/service/pubsub.ts:13


status#

â–ª Static Private status: "ready" | "pending" | "closed" = 'pending'

Defined in#

src/service/pubsub.ts:15

Methods#

bind#

â–¸ Private bind(instance): void

Parameters#

NameType
instancePubSubService

Returns#

void

Defined in#

src/service/pubsub.ts:72


closeAll#

â–¸ closeAll(): Promise<void>

Returns#

Promise<void>

Defined in#

src/service/pubsub.ts:133


getAllSubscriptions#

â–¸ getAllSubscriptions(): Promise<AllSubscriptions[]>

Retrieves a list of subscribers

Returns#

Promise<AllSubscriptions[]>

Defined in#

src/service/pubsub.ts:219


getClient#

â–¸ Private getClient(): PubSubClientV2

Returns#

PubSubClientV2

Defined in#

src/service/pubsub.ts:125


getSubscribers#

â–¸ getSubscribers(): Subscribers

Returns#

Subscribers

Defined in#

src/service/pubsub.ts:129


initClient#

â–¸ initClient(): void

Returns#

void

Defined in#

src/service/pubsub.ts:89


initDriver#

â–¸ Private initDriver(): void

Returns#

void

Defined in#

src/service/pubsub.ts:77


publish#

â–¸ publish<T, P>(topic, message, options): Promise<string>

Publishes new orders to PubSub.

Type parameters#

NameType
Textends Topic<T>
Pextends Payload

Parameters#

NameType
topicT
messageP
optionsPublishOptions

Returns#

Promise<string>

Defined in#

src/service/pubsub.ts:107


shouldStartSynchronousSubscriptions#

â–¸ Private shouldStartSynchronousSubscriptions(): boolean

Returns#

boolean

Defined in#

src/service/pubsub.ts:119


startServer#

â–¸ Private startServer(): void

Returns#

void

Defined in#

src/service/pubsub.ts:25


startSubscriptions#

â–¸ startSubscriptions(): Promise<void>

Returns#

Promise<void>

Defined in#

src/service/pubsub.ts:152


subscribe#

â–¸ subscribe(subscription): Promise<void>

Subscribes to any given topic

Parameters#

NameType
subscriptionSubscriberTuple

Returns#

Promise<void>

Defined in#

src/service/pubsub.ts:212


syncDriverIsEnabled#

â–¸ Private syncDriverIsEnabled(): boolean

Returns#

boolean

Defined in#

src/service/pubsub.ts:85


validate#

â–¸ Protected validate<T, P>(topic, message): void

Validates Topic and Message according to validation rules set in Topic class

Type parameters#

NameType
Textends Topic<T>
Pextends Payload

Parameters#

NameTypeDescription
topicTTopic
messagePMessage

Returns#

void

Defined in#

src/service/pubsub.ts:201


getInstance#

â–¸ Static getInstance(): PubSubService

Returns#

PubSubService

Defined in#

src/service/pubsub.ts:97


isHealthy#

â–¸ Static isHealthy(): boolean

Returns#

boolean

Defined in#

src/service/pubsub.ts:48