Open History to see the last commit
1import * as Layer from "effect/Layer";
2
3import { OrchestrationCommandReceiptRepositoryLive } from "../persistence/Layers/OrchestrationCommandReceipts.ts";
4import { OrchestrationEventStoreLive } from "../persistence/Layers/OrchestrationEventStore.ts";
5import { OrchestrationEngineLive } from "./Layers/OrchestrationEngine.ts";
6import { OrchestrationProjectionPipelineLive } from "./Layers/ProjectionPipeline.ts";
7import { OrchestrationProjectionSnapshotQueryLive } from "./Layers/ProjectionSnapshotQuery.ts";
8import * as ThreadBackgroundLiveness from "./ThreadBackgroundLiveness.ts";
9
10export const OrchestrationEventInfrastructureLayerLive = Layer.mergeAll(
11 OrchestrationEventStoreLive,
12 OrchestrationCommandReceiptRepositoryLive,
13);
14
15export const OrchestrationProjectionPipelineLayerLive = OrchestrationProjectionPipelineLive.pipe(
16 Layer.provide(OrchestrationEventStoreLive),
17);
18
19export const OrchestrationInfrastructureLayerLive = Layer.mergeAll(
20 OrchestrationProjectionSnapshotQueryLive,
21 OrchestrationEventInfrastructureLayerLive,
22 OrchestrationProjectionPipelineLayerLive,
23 // Shared background-liveness registry: written by runtime ingestion,
24 // read by the snapshot query. provideMerge feeds the same instance to
25 // the snapshot query here and re-exports it for runtime ingestion.
26).pipe(Layer.provideMerge(ThreadBackgroundLiveness.layer));
27
28export const OrchestrationLayerLive = Layer.mergeAll(
29 OrchestrationInfrastructureLayerLive,
30 OrchestrationEngineLive.pipe(Layer.provide(OrchestrationInfrastructureLayerLive)),
31);