Files
t3code/apps/server/src/orchestration/Services/ProviderCommandReactor.ts
T

35 lines
1.0 KiB
TypeScript

/**
* ProviderCommandReactor - Provider command reaction service interface.
*
* Owns background workers that react to orchestration intent events and
* dispatch provider-side command execution.
*
* @module ProviderCommandReactor
*/
import { ServiceMap } from "effect";
import type { Effect, Scope } from "effect";
/**
* ProviderCommandReactorShape - Service API for provider command reactors.
*/
export interface ProviderCommandReactorShape {
/**
* Start reacting to provider-intent orchestration domain events.
*
* The returned effect must be run in a scope so all worker fibers can be
* finalized on shutdown.
*
* Filters orchestration domain events to provider-intent types before
* processing.
*/
readonly start: Effect.Effect<void, never, Scope.Scope>;
}
/**
* ProviderCommandReactor - Service tag for provider command reaction workers.
*/
export class ProviderCommandReactor extends ServiceMap.Service<
ProviderCommandReactor,
ProviderCommandReactorShape
>()("t3/orchestration/Services/ProviderCommandReactor") {}