JobContextModule
Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.
Defined in: packages/pipeline-job-context/src/job-context.module.ts:69
Connects withJobContext, @InJobContext and @AsSystem to the
application’s principal port, tenant list, and tenant and correlation id
sources. The decorators wrap methods
outside dependency injection, so they read the registration of the running
module; with none they fail closed. One application registers it once.
Example
Section titled “Example”@Module({ imports: [ JobContextModule.forRoot({ principal: SessionJobPrincipal, tenants: ['tenant_a', 'tenant_b'], sources: { tenantId: tenantSource, correlationId: correlationSource }, imports: [AuthsModule], }), ],})export class JobsModule {}Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new JobContextModule():
JobContextModule
Returns
Section titled “Returns”JobContextModule
Methods
Section titled “Methods”forRoot()
Section titled “forRoot()”
staticforRoot(options):DynamicModule
Defined in: packages/pipeline-job-context/src/job-context.module.ts:85
Builds the module for options.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Throws
Section titled “Throws”When options.tenants is an empty list. A tenant
function that returns an empty list throws when the application starts.
Example
Section titled “Example”JobContextModule.forRoot({ principal: SessionJobPrincipal, tenants: () => persistenceConfig().tenants, sources: { tenantId: tenantSource, correlationId: correlationSource },});