Asynchronous execution library
Asynchronous execution library.
To install multi:
npm install multi
Install from git repository:
git clone https://github.com/derdesign/multi.git
Multi creates a wrapper object containing the same methods as the original object. The wrapped methods can then be run either
in sequence or in parallel, by providing the proper options to the
The following example wraps the
fs module in a Multi object, to perform async file operations:
var fs = ;var Multi = ;var mfs = fs;mfs;mfs;mfs;mfs;mfs;
Multi constructor. Receives an options object. Available options are:
parallel: Determines if the methods will run in parallel. Defaults to
interrupt: Interrupts execution if an error is encountered. Defaults to
flush: Clears the call stack after running
exec. Defaults to
Runs the wrapper methods asynchronously using the configuration passed to the multi constructor. The callback has a
(err, results). If an error occurs,
err will be an array with the errors from the execution stack.
results object is an array containing the arguments provided to callbacks in the execution stack.
pre_exec: Emitted before running the call stack
post_exec: Emitted upon completion, before calling the
multi is MIT Licensed