-
Notifications
You must be signed in to change notification settings - Fork 87
Could the schema execution be made even more async by adding an async executor #1
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
Comments
@japrogramer That is exactly what we are experimenting on right now! For example, if we provide Please, feel free to share you opinion. Why do you want/need an async executor? Do you want it to run in a separate thread or you want it to be based on the main even loop where web-server runs? Probably, we need to introduce an options to make user able to switch between these variants. Speaking of migration you mentioned. Thank you for you trust, but I suppose it is too early to use it in production. We need to elaborate more on this package until we can state it is production-ready. Moreover, I suppose that some backward compatibility braking changes can also be made. |
@prokher one of the reason's I would like and currently have my own implementation to have an async executor is that I would like to make async calls to aioredis. Im not to experienced to know what the difference it would make to run in the main thread than to offloading to a separate thread in terms of scalability which is my main concern. |
@japrogramer I've made the following. Now (since aaa5232) server processes requests (WebSocket messages) in parallel in different worker threads and In spite of query and mutation resolvers seem to work fine, I indeed faced an issue with subscriptions. It looks very similar to the issue you posted to the Now I need to think about a workaround. I always have an option to execute subscription "resolvers" ( |
@prokher I think the issue is more closely related to this graphql-python/graphene-django#452 |
I think this is the piece of code that may be preventing async subscription resolvers to execute as expected. |
It seems that finally (in v0.1.18) all "resolver" methods (such as |
do you mean RxPy now allows async resolves .. or graphene resolver can be async? Im looking into https://github.com/strawberry-graphql/strawberry |
@japrogramer Yes, I meant that "resolvers" of the Query, Mutation & Subscription classes can be implemented as Indeed, strawberry looks interesting. Taking into account the appearance of graphql-core-next and the progress of tartiflette (which seems to develop quite intensively these days), I will probably have to consider adding a replaceable "GraphQL-processing" layer to the current implementation. I am not sure, though. |
DjangoChannelsGraphqlWs/channels_graphql_ws/graphql_ws.py
Line 532 in bb043d4
executor=AsyncioExecutor(loop=asyncio.get_event_loop()),
if this line is changed to include the above as a parameter, does it raise this same issue
graphql-python/graphene-django#452
Really appreciate you sharing your code, I intend to migrate over to this implementation after i do some testing
The text was updated successfully, but these errors were encountered: