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
Name | Type | Description |
---|---|---|
bus | EventBus | The 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
Name | Type |
---|---|
Source | extends string |
Target | extends string | number | symbol |
Parameters
Name | Type | Description |
---|---|---|
sourceTopic | Source | The source topic. |
targetTopic | Target | The target topic. |
sync | boolean | Whether the target topic should be synced across instruments. |
cache | boolean | Whether 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
Name | Type |
---|---|
Source | extends string |
Target | extends string |
Parameters
Name | Type | Description |
---|---|---|
sourceTopic | Source | The source topic. |
targetTopic | Target | The target topic. |
sync | boolean | Whether the target topic should be synced across instruments. |
cache | boolean | Whether 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
Name | Type | Description |
---|---|---|
id | number | The unique ID associated with the republish to stop. |
Returns
boolean
Whether the requested republish was stopped.
Defined in
src/sdk/data/EventRepublisher.ts:105