import mitt from 'mitt';
const WAKE_CHANNEL = 'wake';
/**
 * In-process {@link WakePublisher}. Publication is best-effort: listener
 * failures must not affect the write path that already committed the row.
 */
export class EventEmitterWakePublisher {
    emitter = mitt();
    publish(wake) {
        try {
            this.emitter.emit(WAKE_CHANNEL, wake);
        }
        catch {
            // Best-effort by contract.
        }
    }
    subscribe(listener) {
        this.emitter.on(WAKE_CHANNEL, listener);
        return () => { this.emitter.off(WAKE_CHANNEL, listener); };
    }
    clear() {
        this.emitter.all.clear();
    }
}
//# sourceMappingURL=event-emitter-wake-publisher.js.map