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

Schedule batch loading #7

Closed
LarsJK opened this issue Feb 26, 2020 · 2 comments
Closed

Schedule batch loading #7

LarsJK opened this issue Feb 26, 2020 · 2 comments

Comments

@LarsJK
Copy link

LarsJK commented Feb 26, 2020

I've been trying to come up with a way to schedule the batch loading like graphql/dataloader does with node.js process.onTick. But I can't really find a way since swift is multithreaded and I can't find any onTick.

Have you tried using this on a GraphQL server? When/where do you call try userLoader.dispatchQueue(on: req.eventLoop)? Was thinking I maybe need some kind of middleware to run after all the resolvers..

@kimdv
Copy link
Collaborator

kimdv commented Mar 4, 2020

Hi @LarsJK 👋

It it not implemented. Ported the lib some time ago.
Have been using it to some internal projects. But it maybe a year ago I last used it.

I run userLoader.dispatchQueue(on: req.eventLoop) inside my resolvers.
It worked for me, and solved my problem. 😁

@NeedleInAJayStack
Copy link
Member

This has been resolved by #10

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

No branches or pull requests

3 participants