Comments (3)
Seems like a good idea to rewrite pop() to not be recursive, but I don’t have the spare brain power to think through at the moment how that would be done. I’d rather not resort to setTimeout(pop, 0) because that is quite expensive. On Node.js, it’d be easy to switch to process.nextTick, but I’d like Queue to function consistently in the browser.
Also, I think it’s a feature (although a debatable one) that queue.await invokes immediately if all deferred tasks have completed. In theory you could reuse the same queue multiple times, although I'm not sure how well that is supported at the moment. Related: I way of canceling deferred tasks that have not started and inserting deferred tasks at the head of the queue rather than the tail would be helpful.
from d3-queue.
Agreed. There is a hack (using windows.postmessage) that delivers a more efficient solution but I'm unsure if it's fit to be a part of a standard library or not: http://jsperf.com/nexttick-vs-setzerotimeout-vs-settimeout/ An efficient processNext() in a browser would nevertheless open up a whole new range of interesting code patterns, i.e. "execute this, when the chain is done" type of logic.
from d3-queue.
This is fixed in 7bd5059.
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 indefinitely-long queues. 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.