ad

async-daisychain

Easily create and manage daisychains of async queues.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

0

Maintenance

Last Commit

9yrs ago

Contributors

0

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

async-daisychain

Easily create and manage a chain of async queues. Each queue worker may emit an error or a single memo object to it's callback. just like async#push, an error is handed to the callback given. In the case of a memo, it is forwarded to the next queue. When the last queue finishes the resulting memo is passed to the originating callback.

var daisychain = require("async-daisychain");
// see test/test.js for a couple examples

retry

When an error is passed to the callback the second argument is the memo from the last successful worker and the third argument passed to the callback is the queue_id for the failed queue. These arguments, plus a callback, may be passed to #retry to reinvoke the failed queue and remaining queues on the memo. In a sense, this is reminiscent of ruby's retry statement and was inspired by it. This is particularly handy where a worker might fail due to intermittent IO issues. In most cases it also would make sense to delay for some interval before retrying, but this is not built in currently.

Argument Against

Functionally, this is similar to an async queue whose worker spawns a waterfall for each task. That strategy is actually more flexible as it is not limited to a single memo. On the upside, the added complexity herein provides the retry mechanics and also has opportunity to be improved by having mixed concurrency and also an intellgent backpressure system that has visibility into the whole system, not just it's head.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial