MCPcopy Create free account
hub / github.com/FIND-Lab/AgentWard / runWorker

Function runWorker

worker/model-worker.ts:172–194  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

170}
171
172async function runWorker() {
173 while (running) {
174 const currentStatus = Atomics.load(view, 0);
175
176 if (currentStatus & 0b100) {
177 running = false;
178 break;
179 }
180
181 if ((currentStatus & 0b001) && !processing) {
182 processing = true;
183
184 await processRequestAsync();
185
186 } else if (!processing) {
187 Atomics.wait(view, 0, currentStatus);
188 }
189
190 await new Promise(resolve => setTimeout(resolve, 1));
191 }
192
193 log('info', '[Worker] Exiting');
194}
195
196runWorker().then(() => {
197 process.exit(0);

Callers 1

model-worker.tsFile · 0.85

Calls 2

processRequestAsyncFunction · 0.85
logFunction · 0.85

Tested by

no test coverage detected