Skip to main content

Class: IntervalPacer<E>

A PublishPacer that only allows publishing on an interval.

Type parameters

Name
E

Constructors

constructor

new IntervalPacer<E>(msec): IntervalPacer<E>

Create an IntervalPacer.

Type parameters

Name
E

Parameters

NameTypeDescription
msecnumberTime to wait between publishs in ms

Returns

IntervalPacer<E>

Defined in

src/sdk/data/EventBusPacer.ts:23

Methods

canPublish

canPublish<K>(topic, data): boolean

Determine whether the data can be published based on the time since its prior publish.

Type parameters

NameType
Kextends string | number | symbol

Parameters

NameTypeDescription
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.

Defined in

src/sdk/data/EventBusPacer.ts:35