JobContextHook
The app’s hook for carrying its own context across the queue.
Methods
Section titled “Methods”capture()
Section titled “capture()”capture():
Readonly<Record<string,string>> |undefined
Called in the producer: the string fields to carry (ids only, never secrets).
Returns
Section titled “Returns”Readonly<Record<string, string>> | undefined
run<
T>(context,fn):T
Called in the worker: run fn with the captured fields re-entered.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”context
Section titled “context”Readonly<Record<string, string>>
() => T
Returns
Section titled “Returns”T