Skip to main content

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

ParameterTypeDescription
msecnumberTime 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

ParameterTypeDescription
topickeyof EThe topic data would be sent on.
dataE[K]The data which would be sent.

Returns

boolean

A bool indicating if the data should be published.