@minamorl/root-host
v1.1.7
Published
RootHost
Readme
RootHost
- Subscribes to Core Root and enriches notifications with
seq: bigint,ts: string,version: 1, and optionaltraceId/actor. - Fans out to all registered adapters, preserving order per adapter.
- Executes fanout asynchronously and swallows adapter errors to isolate failures.
- Provides
emit(),compact(), andshutdown();shutdown()waits for adapters'drain().
Usage sketch:
import { RootHost } from '@minamorl/root-host'; import { makeRoot } from '../src/lib/root'; import { SseAdapter } from '@minamorl/root-adapters/sse';
const root = makeRoot(); const sse = new SseAdapter(); const host = new RootHost(root, [sse]); host.emit({ type: 'Create', id: 'x', value: 1 }, { traceId: 't1' });
