Μετάβαση στο περιεχόμενο

createHandlerRunner

Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.

createHandlerRunner(binding): PipelineRunner

Defined in: packages/pipeline/src/services/pipeline-setup.ts:195

Binds a handler method to its compiled pipeline: validates the behavior contracts, reports the chain, and returns the runner the bus or the adapter calls per request.

readonly IPipelineBehavior<unknown, unknown>[]

The instances of plan.behaviorTypes, in order.

PipelineBehaviorDiagnostic[]

Receives contract violations; absent, none are checked.

Constructor

DeclaredKind

(message) => void

Receives one line naming the chain, when the handler has one.

(this, …args) => unknown

The handler’s execute or handle; its name is logged.

{ behaviorTypes: Constructor<IPipelineBehavior<unknown, unknown>>[]; globalBehaviorIds: Set<BehaviorId>; globalOptions: Map<BehaviorId, Record<string, unknown>>; handlerBehaviorTypes: Constructor<IPipelineBehavior<unknown, unknown>>[] | undefined; handlerOptions: Map<BehaviorId, Record<string, unknown>> | undefined; hasPipeline: boolean; mergedOptions: Map<BehaviorId, Record<string, unknown>>; }

Constructor<IPipelineBehavior<unknown, unknown>>[]

Set<BehaviorId>

Map<BehaviorId, Record<string, unknown>> = globals.globalOptions

Constructor<IPipelineBehavior<unknown, unknown>>[] | undefined

Map<BehaviorId, Record<string, unknown>> | undefined

boolean = ...

Map<BehaviorId, Record<string, unknown>>

ContextSources

PipelineRunner

const plan = compileHandlerPlan(CreateUserHandler, 'command', globalBehaviors);
const run = createHandlerRunner({
  handlerType: CreateUserHandler,
  kind: 'command',
  plan,
  method: CreateUserHandler.prototype.execute,
  behaviors: plan.behaviorTypes.map(behavior),
  sources,
});
await run(handler, command);