MCPcopy
hub / github.com/promptfoo/promptfoo / getAvailableWorker

Method getAvailableWorker

src/python/workerPool.ts:86–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84 }
85
86 private getAvailableWorker(): PythonWorker | null {
87 for (const worker of this.workers) {
88 if (worker.isReady() && !worker.isBusy()) {
89 return worker;
90 }
91 }
92 return null;
93 }
94
95 private processQueue(): void {
96 // Drain the entire queue - process all waiting requests with available workers

Callers 2

executeMethod · 0.95
processQueueMethod · 0.95

Calls 2

isReadyMethod · 0.80
isBusyMethod · 0.80

Tested by

no test coverage detected