You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
At first I want to thank you for this awesome project!
Currently, (version 0.23.3), the coroutine type implemented by PyO3 has not attributes such as cr_running, cr_suspended or cr_frame. However, inspecting the status of the coroutine by inspect.getcoroutinestate(my_coro()) results in an exception.
Our use case is to monitor the status of tasks and coroutines to have more insights in their live cycle. It would be quite nice to have at least alternatives attributes or methods to access somehow the state of the coroutine (created/running/suspended/closed).
A current workaround is to wrap pyO3"s coroutine with a usual python coroutine in python code.
I guess in first place it would be a question of design rather implementation.
Thanks 😊
The text was updated successfully, but these errors were encountered:
Thanks for flagging this, it's an interesting question.
Ideally I would prefer PyO3 not have a custom coroutine type but use the standard one, I suspect that things like not having a Python frame would make that complicated though. So for the foreseeable future it will remain as is.
Can you elaborate more on the attributes you access? Are they private? I'm sort of ok exposing attributes for introspection as long as they're public on coroutines and we think adding them won't constrain future development.
Hi,
At first I want to thank you for this awesome project!
Currently, (version 0.23.3), the coroutine type implemented by PyO3 has not attributes such as cr_running, cr_suspended or cr_frame. However, inspecting the status of the coroutine by
inspect.getcoroutinestate(my_coro())
results in an exception.Our use case is to monitor the status of tasks and coroutines to have more insights in their live cycle. It would be quite nice to have at least alternatives attributes or methods to access somehow the state of the coroutine (created/running/suspended/closed).
A current workaround is to wrap pyO3"s coroutine with a usual python coroutine in python code.
I guess in first place it would be a question of design rather implementation.
Thanks 😊
The text was updated successfully, but these errors were encountered: