Class: IntervalPacer<E>
Defined in: src/sdk/data/EventBusPacer.ts:15
A PublishPacer that only allows publishing on an interval.
Type Parameters
| Type Parameter |
|---|
E |
Constructors
Constructor
new IntervalPacer<
E>(msec):IntervalPacer<E>
Defined in: src/sdk/data/EventBusPacer.ts:23
Create an IntervalPacer.
Parameters
| Parameter | Type | Description |
|---|---|---|
msec | number | Time to wait between publishs in ms |
Returns
IntervalPacer<E>
Methods
canPublish()
canPublish<
K>(topic,data):boolean
Defined in: src/sdk/data/EventBusPacer.ts:35
Determine whether the data can be published based on the time since its prior publish.
Type Parameters
| Type Parameter |
|---|
K extends string | number | symbol |
Parameters
| Parameter | Type | Description |
|---|---|---|
topic | keyof E | The topic data would be sent on. |
data | E[K] | The data which would be sent. |
Returns
boolean
A bool indicating if the data should be published.