/** * memory-transport.ts, an in-process stand-in for the multicast socket. * * Exported rather than kept in a test file because both consumer repositories * need it: a composition that wires the election has to be able to prove its * own wiring without opening a socket or waiting real seconds. * * It models the two properties of the real transport that the state machine * actually depends on: every attached node receives every datagram INCLUDING * its own (loopback is on), and delivery is synchronous relative to the * injected clock. `partition` reproduces a split network so a heal can be * tested; datagrams sent across a partition boundary are dropped, exactly as a * severed link would drop them. */ import type { ClusterTransport, ClusterTransportDescription } from './types.js'; /** A shared segment. Every transport built from one bus can hear the others. */ export declare class MemoryClusterBus { private readonly attachments; /** Segment id per transport; different ids cannot hear each other. */ private readonly segments; /** Every datagram sent, for tests that assert on protocol ordering. */ readonly sent: { readonly from: string; readonly raw: string; }[]; createTransport(label: string): MemoryClusterTransport; /** Move a transport onto a named network segment. */ partition(transport: MemoryClusterTransport, segment: string): void; /** Put every transport back on one segment. */ heal(): void; attach(transport: MemoryClusterTransport, onMessage: (raw: string) => void): void; detach(transport: MemoryClusterTransport): void; broadcast(from: MemoryClusterTransport, raw: string): void; } export declare class MemoryClusterTransport implements ClusterTransport { private readonly bus; readonly label: string; private running; constructor(bus: MemoryClusterBus, label: string); start(onMessage: (raw: string) => void): Promise; send(raw: string): Promise; stop(): Promise; describe(): ClusterTransportDescription; } //# sourceMappingURL=memory-transport.d.ts.map