After calling `agent_session.shutdown(drain=True)`...
# ask-ai
b
After calling
agent_session.shutdown(drain=True)
, how can I wait until the drain completes?
✅ 1
t
Thanks for reaching out, Masayuki. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're asking how to wait until the drain completes after calling
agent_session.shutdown(drain=True)
— good question. Call
await agent_session.aclose()
after
shutdown(...)
.
shutdown()
initiates a non-blocking graceful shutdown;
aclose()
is awaitable and will pause execution until the drain and close operations finish. Sources: Job lifecycle | LiveKit Documentation, with interactive elements