MCPcopy
hub / github.com/microsoft/agent-lightning / _dequeue_only_task

Function _dequeue_only_task

tests/benchmark/micro_benchmark.py:233–251  ·  view source on GitHub ↗
(args: tuple[str, str, str])

Source from the content-addressed store, hash-verified

231
232
233def _dequeue_only_task(args: tuple[str, str, str]) -> bool:
234 store_url, worker_id, task_id = args
235 console.print(f"[Dequeue-Only Task {task_id}] Dequeueing rollout for worker {worker_id}")
236 store = agl.LightningStoreClient(store_url)
237
238 async def _async_task() -> bool:
239 attempted = await store.dequeue_rollout() # no worker_id
240 if attempted is None:
241 console.print(f"[Dequeue-Only Task {task_id}] No rollout available to dequeue")
242 return False
243 return True
244
245 try:
246 return asyncio.run(_async_task())
247 except Exception as e:
248 console.print(f"Error dequeueing only worker {worker_id} for task {task_id}: {e}")
249 return False
250 finally:
251 _close_store_client(store)
252
253
254def dequeue_rollouts(store_url: str) -> BenchmarkSummary:

Callers

nothing calls this directly

Calls 3

_async_taskFunction · 0.85
_close_store_clientFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected