Comments (1)
I think this is sufficiently different that you’d want a different class. With queue.await and queue.awaitAll, the allowed call pattern is {defer*, await?} or {defer*, awaitAll?}. With queue.awaitNone, it is the opposite: {awaitNone, defer*}. However, there would be no way to prevent {defer*, awaitNone, defer*}, i.e., to prevent queue.defer calls before queue.awaitNone is called. And in that case, you may have accrued results from deferred tasks, so what do you do (discard the results? throw an error? repeatedly invoke the awaitNone callback with each result?).
Seems like a better approach would to be to specify this mode at the time the queue is constructed, e.g., a d3.queueVoid constructor. (Not a good name…)
This also complicates the implementation quite a bit, since now you need a linked list to store the waiting and active tasks lists, so that you can efficiently discard references to tasks as they complete. I’ve implemented that in the linked-list branch, but it increases the library size somewhat.
I think given the work involved and the non-obvious immediate value of this feature, I’m going to close this request. It might be worth revisiting in the future though!
from d3-queue.
Related Issues (20)
- If a task errors, active tasks should be aborted. HOT 1
- Handle synchronous errors. HOT 1
- Support for tasks that depend on previous results. HOT 1
- Support for promises. HOT 1
- d3_queue Uncaught Error HOT 3
- The keyword 'await' is reserved HOT 24
- Uncaught TypeError: d3.queue is not a function HOT 2
- await/awaitAll called before pending tasks are complete after a call to queue.abort() HOT 4
- queue.js has errors when processed with ES2015 HOT 2
- Clarify the difference between await() and awaitAll() HOT 1
- .progress() or .tick() method? HOT 2
- Errors thrown inside .await() are silenced HOT 1
- The keyword 'await' is reserved HOT 2
- .awaitAll calling early HOT 2
- bind variable to .await() HOT 2
- Cannot catch 422 errors HOT 4
- Array of queues with one awaitAll HOT 6
- Uncaught TypeError: d3.queue is not a function D3v5 vanilla HOT 2
- Allow "defer after await" at any time before notification triggered HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-queue.