flow.js
Introduction
flow.js is a synchron-asynchron flow control library which runs on node and in browsers. The functionallity of the library is inspired by node-seq (https://github.com/substack/node-seq) and async (https://github.com/caolan/async). The source is written from scratch.
Features
- sequence flow (seq)
- parallel flow (par) - executes functions in parallel
- parallel flow for each (parEach) - execute one function in parallel for each item inside a given as array or object
- seqEach - execute sequence for each function given as array
- end - breaks the flow from inside an action
Possible features (if somebody like or need)
- catch - adds a catch action, which will handle erros instead of exec action
- autoexec - automatically execute flow
Usage
Create a flow and execute
;
Add a sequence
execute synchron method in sequence
;
execute synchron method in sequence
;
sequence with variable registration
;
Add parallel control flow
asynchron and synchron control parallel control flows
;
asynchron and synchron control parallel with variable registration
;
synchron control parallel each without variable registration
synchron control parallel each with variable registration
asynchron control parallel each with and without variable registration
end flow from inside an synchron action
Changelog
0.2.3
- added global error handler, which get called if an error occurs in exec block