Skip to content
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

Fix running execute and subscribe of client in a new Thread #135

Conversation

leszekhanusz
Copy link
Collaborator

@leszekhanusz leszekhanusz commented Aug 27, 2020

In a new Thread, there is no default asyncio event loop like the main thread
And if we do asyncio.get_event_loop() OR if we create an asyncio.Event()
Then a RuntimeError will be generated

This commit fixes this problem.
This should fix the issue #134 and allow to use gql inside Flask which is multiThreaded

In a new Thread, there is no default asyncio event loop like the main thread
And if we do asyncio.get_event_loop() OR if we create an asyncio.Event()
Then a RuntimeError will be generated
@KingDarBoja
Copy link
Contributor

That was a fast pull request, I will review this night :)

@KingDarBoja KingDarBoja added status: waiting for reviewer Waiting for a maintainer to review type: bug An issue or pull request relating to a bug labels Aug 27, 2020
Copy link
Contributor

@KingDarBoja KingDarBoja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Windows 10, no issues so far, everything is ok! 🚀

@KingDarBoja KingDarBoja removed the status: waiting for reviewer Waiting for a maintainer to review label Aug 29, 2020
@leszekhanusz leszekhanusz merged commit 0acea14 into graphql-python:master Sep 7, 2020
@leszekhanusz leszekhanusz deleted the fix_get_current_loop_in_new_thread branch September 7, 2020 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants