Skip to main content
Version: v1

Class: Topic

Implements#

  • NamedTopic
  • TopicWithCustomProject

Constructors#

constructor#

• new Topic()

Defined in#

src/topic/index.ts:50

Properties#

mq#

• Protected mq: PubSubService

Defined in#

src/topic/index.ts:48


name#

• Readonly name: string = ''

Implementation of#

NamedTopic.name

Defined in#

src/topic/index.ts:33


project#

• Optional project: GooglePubSubProject

Implementation of#

TopicWithCustomProject.project

Defined in#

src/topic/index.ts:34


retryConfig#

• retryConfig: RetryConfig

Defined in#

src/topic/index.ts:36

Methods#

getName#

â–¸ getName(): string

Returns#

string

Defined in#

src/topic/index.ts:86


publish#

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

Type parameters#

NameType
Textends Payload

Parameters#

NameType
messageT
options?TopicPublishOptions

Returns#

Promise<string>

Defined in#

src/topic/index.ts:61


validateMessage#

â–¸ validateMessage(message): void

todo implement message validation logic. tried to link Topic and Message using static name methods, but hit a wall with subclass static inheritance typescript issues

Parameters#

NameTypeDescription
messagePayloadMessage

Returns#

void

Defined in#

src/topic/index.ts:57


validateTopic#

â–¸ validateTopic(name): void

Parameters#

NameType
namestring

Returns#

void

Defined in#

src/topic/index.ts:90