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

OrchestrationReactor.ts

30 lines1.0 KB

1import { Effect, Layer } from "effect";
2​
3import {
4 OrchestrationReactor,
5 type OrchestrationReactorShape,
6} from "../Services/OrchestrationReactor.ts";
7import { CheckpointReactor } from "../Services/CheckpointReactor.ts";
8import { ProviderCommandReactor } from "../Services/ProviderCommandReactor.ts";
9import { ProviderRuntimeIngestionService } from "../Services/ProviderRuntimeIngestion.ts";
10​
11export const makeOrchestrationReactor = Effect.gen(function* () {
12 const providerRuntimeIngestion = yield* ProviderRuntimeIngestionService;
13 const providerCommandReactor = yield* ProviderCommandReactor;
14 const checkpointReactor = yield* CheckpointReactor;
15​
16 const start: OrchestrationReactorShape["start"] = Effect.gen(function* () {
17 yield* providerRuntimeIngestion.start;
18 yield* providerCommandReactor.start;
19 yield* checkpointReactor.start;
20 });
21​
22 return {
23 start,
24 } satisfies OrchestrationReactorShape;
25});
26​
27export const OrchestrationReactorLive = Layer.effect(
28 OrchestrationReactor,
29 makeOrchestrationReactor,
30);