-
Notifications
You must be signed in to change notification settings - Fork 515
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
.NET Port #30
Comments
The key consideration is that you need a way to capture the calls to data loader during a single stack frame of execution. There are two ways to do this:
This dataloader library for JavaScript actually uses approach 2) via the Promises "micro task queue" - which is a queue of operations to perform that begins empty at each call stack and is executed when the call stack unwinds. However if we had built this library before native Promises (or via using a Promise "polyfill") we use approach 1) where we enqueue work on the event loop (i.e. setTimeout). Most, but not all, environments have an event loop - so the event loop approach is usually a good one. Nearly all environments have a call stack. If the native call stack does not support an "on unwind" task queue (likely) then a suitable substitute is to create a base function which you use everywhere a call stack could be created: in your program's |
Closing this issue since questions were answered. |
Same question as #26 but for .NET.
The text was updated successfully, but these errors were encountered: