MCPcopy Index your code
hub / github.com/google/adk-python / monitor

Method monitor

src/google/adk/cli/api_server.py:1495–1509  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1493 worker_task = asyncio.create_task(worker())
1494
1495 async def monitor():
1496 try:
1497 while True:
1498 message = await request.receive()
1499 if message.get("type") == "http.disconnect":
1500 logger.warning(
1501 "Client disconnected. Aborting agent run for session %s.",
1502 req.session_id,
1503 )
1504 worker_task.cancel()
1505 break
1506 except asyncio.CancelledError:
1507 pass
1508 except Exception as e: # pylint: disable=broad-exception-caught
1509 logger.error("Exception in disconnect monitor: %s", e, exc_info=True)
1510
1511 monitor_task = asyncio.create_task(monitor())
1512

Callers

nothing calls this directly

Calls 4

receiveMethod · 0.45
getMethod · 0.45
cancelMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected