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

Support custom schedulers #228

Merged
merged 1 commit into from
Nov 17, 2019
Merged

Support custom schedulers #228

merged 1 commit into from
Nov 17, 2019

Conversation

leebyron
Copy link
Contributor

Originally discussed as early as issue #1! DataLoader's primary value is providing performant coalescing batching. It does this by exploiting knowledge of how Node's job queue runs (and just using setImmediate in the browser). However many ports of this library have not found equivalent mechanisms in their host runtime and have instead opted for either a timer-based solution, manual dispatching, or tight integration into a custom GraphQL executor. All of these approaches are perfectly valid and it's time that the original implementation provide the capability to explore these mechanisms as well.

This PR allows overriding the built-in default enqueuePostPromiseJob scheduler with any arbitrary function. The Readme documentation has been amended to show examples of time-window collection (via setTimeout) and manual dispatch.

Closes #225

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.

[REQUEST] Support manual dispatch?
1 participant