The resolved type of the factory's promises.
The rejected type of the factory's promises.
The type to extend the phases supported by a poll.
The polling frequency parameters.
We implement the "decorrelated jitter" strategy from
https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/.
Essentially, if consecutive retries are needed, we choose an integer:
sleep = min(max, rand(interval, backoff * sleep))
This ensures that the poll is never less than interval
, and nicely
spreads out retries for consecutive tries. Over time, if (interval < max),
the random number will be above max
about (1 - 1/backoff) of the time
(sleeping the max
), and the rest of the time the sleep will be a random
number below max
, decorrelating our trigger time from other pollers.
The phase of the poll when the current tick was scheduled.
Definition of poll state at any given time.
A signal emitted when the poll is disposed.
The polling frequency data.
Whether the poll is disposed.
The name of the poll.
The poll state, which is the content of the currently-scheduled poll tick.
A promise that resolves when the currently-scheduled tick completes.
Usually this will resolve after state.interval
milliseconds from
state.timestamp
. It can resolve earlier if the user starts or refreshes the
poll, etc.
A signal emitted when the poll state changes, i.e., a new tick is scheduled.
Generated using TypeDoc
A namespace for
IPoll
types.