UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

25 lines (24 loc) • 786 B
import { i as resolveGlobalSet } from "./global-singleton-D7yf05nR.mjs"; //#region src/auto-reply/reply/dispatcher-registry.ts /** * Global registry for tracking active reply dispatchers. * Used to ensure gateway restart waits for all replies to complete. */ const activeDispatchers = resolveGlobalSet(Symbol.for("openclaw.activeReplyDispatchers"), "close-only"); /** * Returns an unregister function to call when the dispatcher is no longer needed. */ function registerDispatcher(e) { const t = { pending: e }; activeDispatchers.add(t); return () => { activeDispatchers.delete(t); }; } function getTotalPendingReplies() { let e = 0; for (const t of activeDispatchers) e += t.pending(); return e; } //#endregion export { registerDispatcher as n, getTotalPendingReplies as t };