YouTag
YouTag copied to clipboard
Enables NIO-based Concurrent Execution
The existing concurrent executor was a mix of DispatchQueue.async calls and NIO futures, and was only used on an opt-in basis.
This makes the following changes:
- Adds a fully NIO-based concurrent executor
- Makes it the default executor used on query and subscription operations
- Deprecates APIs that allow specifying particular executors, as well as the DispatchQueue-based executor.
This should better parallelize GraphQL queries by default, resulting in improved performance.
Changes to default values are typically considered major, however this seems to be an exception. The GraphQL spec states the resolvers of queries must be side-effect free and idempotent, the execution order must not affect the result, which means that this can be considered a minor based on the resolver idempotency agreement.
The reasoning for the deprecation is that the JavaScript reference implementation does not expose executor implementations to the caller, instead always executing query and subscription concurrently and mutation serially. Furthermore, Graphiti does not allow customization of executors, implying that it is a rarely used feature.
Is this good for review?
Any reason you aren't moving to Swift concurrency?
Any reason you aren't moving to Swift concurrency?
No, no reason in particular. This was opened back in January, and I was hoping that it would be a pretty small change to align with the intuition of a Concurrent executor.
You make a great point though - if we're going to make a breaking change, I think it makes sense for us to move completely onto Swift Concurrency and drop NIO support. I've started an MR for that here: https://github.com/GraphQLSwift/GraphQL/pull/166 I'd love your feedback!!
@NeedleInAJayStack can I close this PR?
@paulofaria Yeah, let's close it.
Closing in favor of https://github.com/GraphQLSwift/GraphQL/pull/166