Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

OrchestrationReactor.ts

32 lines1.0 KB

1/**
2 * OrchestrationReactor - Composite orchestration reactor service interface.
3 *
4 * Coordinates startup of orchestration runtime reactors that translate domain
5 * events into downstream side effects.
6 *
7 * @module OrchestrationReactor
8 */
9import * as Context from "effect/Context";
10import type * as Effect from "effect/Effect";
11import type * as Scope from "effect/Scope";
12​
13/**
14 * OrchestrationReactorShape - Service API for orchestration reactor lifecycle.
15 */
16export interface OrchestrationReactorShape {
17 /**
18 * Start orchestration-side reactors for provider/runtime/checkpoint flows.
19 *
20 * The returned effect must be run in a scope so all worker fibers can be
21 * finalized on shutdown.
22 */
23 readonly start: () => Effect.Effect<void, never, Scope.Scope>;
25​
26/**
27 * OrchestrationReactor - Service tag for orchestration reactor coordination.
28 */
29export class OrchestrationReactor extends Context.Service<
30 OrchestrationReactor,
31 OrchestrationReactorShape
32>()("t3/orchestration/Services/OrchestrationReactor") {}