-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Run clients with ephemeral applications on the global event loop thread #9870
Conversation
✅ Deploy Preview for prefect-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
…ency` in CI Test is timing out with threaded clients
This is:
This pull request appears to:
It's unclear what the best path forward is, but a more holistic approach will need to be taken. @jakekaplan is best suited to take over this work. |
This pull request is stale because it has been open 60 days with no activity. To keep this pull request open remove stale label or comment. |
Closing this as I am not working on it and a new pull request will need to be opened if someone else takes it up. |
When a client is hooked to an ephemeral application, its moved to the global event loop instead of the event loop it is created on. We do this by sending the underlying httpx client's context manager to the global event loop and patch the
client.request
method to send coroutines to the other thread. This is a good stepping stone towards providing a singleton client that runs on the global event loop as well as towards providing a synchronous client.Enabling this only for the ephemeral application is motivated by #9855 which requires SQLAlchemy to be managed on a separate thread than user code.