registerJobContext
registerJobContext(
options): () =>void
Defined in: packages/pipeline-job-context/src/register-job-context.ts:38
Makes options the job context of this process: withJobContext stamps payloads
with it, @InJobContext() restores it, and @AsSystem declares system principals
through it. One application registers it once, at startup.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”A function that removes this registration, for shutdown.
() => void
Throws
Section titled “Throws”TypeError when tenants is empty.
Example
Section titled “Example”const unregister = registerJobContext({ principal: new SessionJobPrincipal(sessions), tenants: ['acme', 'globex'], sources: { tenantId: tenantSource, correlationId: correlationSource },});process.on('SIGTERM', unregister);