WorkerContext

Per-invocation state handed to a BackgroundWorker's execute() call.

Cancellation flows through coroutine cancellation — there is no separate scope field. To launch sibling work inside a worker, use coroutineScope / supervisorScope within execute().

Constructed by the library; not user-instantiable.

Properties

Link copied to clipboard

0-based attempt counter. Increments on each WorkResult.Retry cycle.

Link copied to clipboard

Runtime constraints and capabilities the platform offers this invocation.

Link copied to clipboard

Key/value bag supplied at schedule time via WorkRequest.input.

Link copied to clipboard

The stable task id this invocation was dispatched for.