Skip to content

createFixtureController

createFixtureController<Context>(options: { context: Context; drain?: (context: Context, execution: FixtureExecution) => void | PromiseLike<void>; operations?: Readonly<Record<string, FixtureOperation<Context>>>; pause?: () => FixtureHold; reset?: (context: Context, execution: FixtureExecution) => void | Readonly<Record<string, JsonValue>> | PromiseLike<void | Readonly<Record<string, JsonValue>>>; workerId: string; }): FixtureController

Own fixture admission for one real app worker. Operations receive (context, input, execution); reset and drain receive (context, execution). Execution contains identity and an abort signal. A reset requires a synchronous app admission hold, acquired before the controller returns.

Type Parameter
Context
Parameter Type
options { context: Context; drain?: (context: Context, execution: FixtureExecution) => void | PromiseLike<void>; operations?: Readonly<Record<string, FixtureOperation<Context>>>; pause?: () => FixtureHold; reset?: (context: Context, execution: FixtureExecution) => void | Readonly<Record<string, JsonValue>> | PromiseLike<void | Readonly<Record<string, JsonValue>>>; workerId: string; }
options.context Context
options.drain? (context: Context, execution: FixtureExecution) => void | PromiseLike<void>
options.operations? Readonly<Record<string, FixtureOperation<Context>>>
options.pause? () => FixtureHold
options.reset? (context: Context, execution: FixtureExecution) => void | Readonly<Record<string, JsonValue>> | PromiseLike<void | Readonly<Record<string, JsonValue>>>
options.workerId string

FixtureController