MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / non_streaming_monitor_fn

Function non_streaming_monitor_fn

api_utils/queue_worker.py:313–330  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

311 res_fut = cast(Future, result_future)
312
313 async def non_streaming_monitor_fn():
314 nonlocal client_disconnected_early
315 while not res_fut.done():
316 if GlobalState.IS_SHUTTING_DOWN.is_set():
317 res_fut.cancel()
318 break
319 if not await _test_client_connection(
320 req_id, http_request
321 ):
322 client_disconnected_early = True
323 res_fut.set_exception(
324 HTTPException(
325 status_code=499,
326 detail="Client disconnected",
327 )
328 )
329 break
330 await asyncio.sleep(0.3)
331
332 disconnect_monitor_task = asyncio.create_task(
333 non_streaming_monitor_fn()

Callers 1

queue_workerFunction · 0.85

Calls 1

_test_client_connectionFunction · 0.85

Tested by

no test coverage detected