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

Concurrency #21

Merged
merged 18 commits into from
Oct 26, 2024
Merged

Concurrency #21

merged 18 commits into from
Oct 26, 2024

Conversation

ZirgVoice
Copy link
Contributor

This is a dataloader implementation using swift concurrency

Copy link
Member

@NeedleInAJayStack NeedleInAJayStack left a comment

Choose a reason for hiding this comment

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

Thanks for contributing @ZirgVoice! Overall, these changes look good! My only big concern is that they make significant changes to the public API, which would result in a major version bump, and dropping support for the NIO EventLoop based API, which others may rely on.

How would you feel about preserving the NIO implementation, but offering this async implementation as a separate API? For example, we could either A) create this as an AsyncDataLoader class, B) offer a separate AsyncDataLoader library product from this swift package, or C) create a new GraphQLSwift/AsyncDataLoader repo. Personally, I lean toward option B, but I'd be interested in your thoughts! Thanks again!

ZirgVoice and others added 2 commits October 16, 2024 09:45
Co-authored-by: Jay Herron <30518755+NeedleInAJayStack@users.noreply.github.com>
@ZirgVoice
Copy link
Contributor Author

Thanks for contributing @ZirgVoice! Overall, these changes look good! My only big concern is that they make significant changes to the public API, which would result in a major version bump, and dropping support for the NIO EventLoop based API, which others may rely on.

How would you feel about preserving the NIO implementation, but offering this async implementation as a separate API? For example, we could either A) create this as an AsyncDataLoader class, B) offer a separate AsyncDataLoader library product from this swift package, or C) create a new GraphQLSwift/AsyncDataLoader repo. Personally, I lean toward option B, but I'd be interested in your thoughts! Thanks again!

Thanks for the feedback! I agree, option B seems like the best approach.

@ZirgVoice
Copy link
Contributor Author

ZirgVoice commented Oct 17, 2024

offer a separate AsyncDataLoader library product from this swift package

I made a separate library product AsyncDataLoader

@NeedleInAJayStack
Copy link
Member

Thanks! Looks like there's just a few CI tasks left to do.

To fix the linting, you should be able to run this on the repo and commit the changes:

docker run --rm -v ./:/repo ghcr.io/nicklockwood/swiftformat:latest /repo

And if we're bumping to Swift 5.10 dependence, we will need to remove the previous Swift versions from CI.

Finally, it'd be good to know why DataLoaderTests.testMultipleRequestsWithMaxBatchSize is failing on Linux: https://github.com/GraphQLSwift/DataLoader/actions/runs/11380587915/job/31711239999?pr=21#step:4:508

@ZirgVoice
Copy link
Contributor Author

The test testMultipleRequestsWithMaxBatchSize was failing because the operations are executed in parallel, which led to an incorrect order. The order doesn't matter for us, so I changed the check to count the elements in the arrays.

@ZirgVoice
Copy link
Contributor Author

I changed the swift-tools-version to 5.9 because swift-atomics requires version 5.9. In the workflows, I removed versions 5.7 and 5.8.

@NeedleInAJayStack
Copy link
Member

Sorry about the delay. This looks great! Thanks!

@NeedleInAJayStack NeedleInAJayStack merged commit 52b1f3d into GraphQLSwift:main Oct 26, 2024
5 checks passed
@NeedleInAJayStack
Copy link
Member

I pulled this into v2.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants