Interface: PollContext\<T, A\>
Per-iteration context handed to PollProducer and the
predicate on each step of a poll loop. Bundles the
iteration metadata so the call signatures stay stable as poll
grows additional fields.
signal is owned by poll: it tracks the external
PollOptions.signal (when supplied) and also fires when the
consumer breaks out of the loop, so producers can forward it to
any in-flight work (fetch, SDK calls, etc.) and have a single
cancellation source tear down both the request and the loop.
attributes is a mutable scratchpad shared across every
iteration of a single poll run. The same object reference is
passed each call so writes from one iteration are visible to the
next - useful for stashing per-loop state (retry counters, start
timestamps, anything you’d otherwise close over via a let).
Generic A lets callers type the bag; defaults to
Record<string, unknown>.
Type Parameters
Section titled “Type Parameters”T
A = Record<string, unknown>
Properties
Section titled “Properties”attempt
Section titled “attempt”attempt:
number
Zero-based iteration index (0 on the first call).
attributes
Section titled “attributes”attributes:
A
Per-run mutable scratchpad shared across iterations.
previous
Section titled “previous”previous:
T|undefined
Value yielded on the prior iteration; undefined on the first.
signal
Section titled “signal”signal:
AbortSignal
Cancellation handle. Always defined; forward to in-flight work.