Tankōbon / main/services/request-pacer / createRequestPacer
Function: createRequestPacer()
createRequestPacer(
intervalMs,clock?):RequestPacer
Defined in: main/services/request-pacer.ts:49
A pacer letting one request through every intervalMs at most. Each caller reserves its slot right away (before it sleeps), so callers that arrive together are spaced out one after another instead of all waking at once; the first request of a quiet period goes through without waiting. A caller that gives up keeps its slot, which only makes the next one wait a little longer.
Parameters
intervalMs
number
clock?
PacerClock = realClock