MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / drain

Function drain

e2e/src/clients/agent-chat-tui.ts:141–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

139const queue: TheaterEvent[] = [];
140let draining = false;
141const drain = async () => {
142 if (draining) return;
143 draining = true;
144 while (queue.length > 0) {
145 const event = queue.shift();
146 if (!event) break;
147 const keepGoing = await handle(event);
148 if (!keepGoing) {
149 process.exit(0);
150 }
151 }
152 draining = false;
153};
154
155const input = eventsFifo ? createReadStream(eventsFifo) : process.stdin;
156createInterface({ input, terminal: false }).on("line", (line) => {

Callers 1

agent-chat-tui.tsFile · 0.85

Calls 1

handleFunction · 0.70

Tested by

no test coverage detected