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

ProviderCommandReactor.ts

34 lines1.0 KB

1/**
2 * ProviderCommandReactor - Provider command reaction service interface.
3 *
4 * Owns background workers that react to orchestration intent events and
5 * dispatch provider-side command execution.
6 *
7 * @module ProviderCommandReactor
8 */
9import { ServiceMap } from "effect";
10import type { Effect, Scope } from "effect";
11​
12/**
13 * ProviderCommandReactorShape - Service API for provider command reactors.
14 */
15export interface ProviderCommandReactorShape {
16 /**
17 * Start reacting to provider-intent orchestration domain events.
18 *
19 * The returned effect must be run in a scope so all worker fibers can be
20 * finalized on shutdown.
21 *
22 * Filters orchestration domain events to provider-intent types before
23 * processing.
24 */
25 readonly start: Effect.Effect<void, never, Scope.Scope>;
27​
28/**
29 * ProviderCommandReactor - Service tag for provider command reaction workers.
30 */
31export class ProviderCommandReactor extends ServiceMap.Service<
32 ProviderCommandReactor,
33 ProviderCommandReactorShape
34>()("t3/orchestration/Services/ProviderCommandReactor") {}