-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use sync API in event loop #41
Comments
I started a conversation about this on Twitter and the main suggestions were:
|
Merged
Merged
This was referenced May 1, 2023
I ended up going down the same road as Jupyter and if a loop is already running we start a second loop in a new thread and run coroutines there. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently the sync API cannot be used in an asyncio event loop. We have an xfailing test which was added in #40 to demonstrate this.
kr8s/kr8s/tests/test_api.py
Lines 60 to 64 in 6cf29b2
This situation will come up a lot in Jupyter as there is always an event loop running but many users may expect to be able to use the sync API and will not consider asyncio at all.
We need to be able to support the sync API (which uses
asyncio.run
under the hood) in an event loop.The text was updated successfully, but these errors were encountered: