inspect.getcoroutinestate(coroutine)
Get current state of a coroutine object. The function is intended to be used with coroutine objects created by async def
functions, but will accept any coroutine-like object that has cr_running
and cr_frame
attributes.
- Possible states are:
-
- CORO_CREATED: Waiting to start execution.
- CORO_RUNNING: Currently being executed by the interpreter.
- CORO_SUSPENDED: Currently suspended at an await expression.
- CORO_CLOSED: Execution has completed.
New in version 3.5.
Please login to continue.