MCPcopy Index your code
hub / github.com/Microck/opencode-studio / flushSubscriber

Function flushSubscriber

server/index.js:156–171  ·  view source on GitHub ↗
(sub)

Source from the content-addressed store, hash-verified

154}
155
156function flushSubscriber(sub) {
157 if (sub.draining || sub.closed) return;
158 while (sub.queue.length > 0) {
159 const chunk = sub.queue[0];
160 const ok = sub.res.write(chunk);
161 if (!ok) {
162 sub.draining = true;
163 sub.res.once('drain', () => {
164 sub.draining = false;
165 flushSubscriber(sub);
166 });
167 return;
168 }
169 sub.queue.shift();
170 }
171}
172
173function setupLogWatcher() {
174 if (!fs.existsSync(LOG_DIR)) return;

Callers 2

enqueueLogLineFunction · 0.85
index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected