Skip to main content

Class: EventRepublisher<SourceEvents, TargetEvents>

Republishes event bus topics.

Type parameters

Name
SourceEvents
TargetEvents

Constructors

constructor

new EventRepublisher<SourceEvents, TargetEvents>(bus): EventRepublisher<SourceEvents, TargetEvents>

Constructor.

Type parameters

Name
SourceEvents
TargetEvents

Parameters

NameTypeDescription
busEventBusThe event bus.

Returns

EventRepublisher<SourceEvents, TargetEvents>

Defined in

src/sdk/data/EventRepublisher.ts:27

Methods

clearRepublishes

clearRepublishes(): void

Clears all republishes from this publisher.

Returns

void

Defined in

src/sdk/data/EventRepublisher.ts:121


startRepublish

startRepublish<Source, Target>(sourceTopic, targetTopic, sync, cache): number

Starts republishing data from a source topic to a target topic. Republishing will begin as soon as the target topic has at least one subscriber, or immediately if the target topic data is synced across instruments.

Type parameters

NameType
Sourceextends string
Targetextends string | number | symbol

Parameters

NameTypeDescription
sourceTopicSourceThe source topic.
targetTopicTargetThe target topic.
syncbooleanWhether the target topic should be synced across instruments.
cachebooleanWhether the target topic data should be cached.

Returns

number

A unique ID associated with the republish.

Defined in

src/sdk/data/EventRepublisher.ts:39

startRepublish<Source, Target>(sourceTopic, targetTopic, sync, cache, map): number

Starts republishing data from a source topic to a target topic after the data has been transformed by a mapping function. Republishing will begin as soon as the target topic has at least one subscriber, or immediately if the target topic data is synced across instruments.

Type parameters

NameType
Sourceextends string
Targetextends string

Parameters

NameTypeDescription
sourceTopicSourceThe source topic.
targetTopicTargetThe target topic.
syncbooleanWhether the target topic should be synced across instruments.
cachebooleanWhether the target topic data should be cached.
map(sourceData: SourceEvents[Source]) => TargetEvents[Target]A mapping function to use to transform the source data.

Returns

number

A unique ID associated with the republish.

Defined in

src/sdk/data/EventRepublisher.ts:59


stopRepublish

stopRepublish(id): boolean

Stops a republish handled by this publisher.

Parameters

NameTypeDescription
idnumberThe unique ID associated with the republish to stop.

Returns

boolean

Whether the requested republish was stopped.

Defined in

src/sdk/data/EventRepublisher.ts:105