/**
 * In-process {@link WakePublisher}. Publication is best-effort: listener
 * failures must not affect the write path that already committed the row.
 */
export class EventEmitterWakePublisher {
    listeners = new Set();
    publish(wake) {
        for (const listener of Array.from(this.listeners)) {
            try {
                listener(wake);
            }
            catch {
                // Best-effort by contract.
            }
        }
    }
    subscribe(listener) {
        this.listeners.add(listener);
        return () => { this.listeners.delete(listener); };
    }
    clear() {
        this.listeners.clear();
    }
}
//# sourceMappingURL=event-emitter-wake-publisher.js.map