Files
t3code/apps/server/src/orchestration/Layers/RuntimeReceiptBus.ts
T
Julius Marminge 18f19a6fe8 Add perf regression coverage for dense stream workloads
- Expand perf fixtures with multi-thread live stream events and namespaced IDs
- Harden stream getters and update web perf tests for the heavier workload
2026-04-01 18:56:42 -07:00

21 lines
620 B
TypeScript

import { Effect, Layer, PubSub, Stream } from "effect";
import {
RuntimeReceiptBus,
type RuntimeReceiptBusShape,
type OrchestrationRuntimeReceipt,
} from "../Services/RuntimeReceiptBus.ts";
const makeRuntimeReceiptBus = Effect.gen(function* () {
const pubSub = yield* PubSub.unbounded<OrchestrationRuntimeReceipt>();
return {
publish: (receipt) => PubSub.publish(pubSub, receipt).pipe(Effect.asVoid),
get stream() {
return Stream.fromPubSub(pubSub);
},
} satisfies RuntimeReceiptBusShape;
});
export const RuntimeReceiptBusLive = Layer.effect(RuntimeReceiptBus, makeRuntimeReceiptBus);