co-agent
in co warp deal with asynchronous concurrency
Installation
$ npm install co-agent
Usage
reference module:
const CoAgent = ;
parameters configure and generating instance:
const coagent = pool: 20 safe: true timeout: 5000;
use instance wrap generator function or other iterator object:
// wrap can use genrator , genrator function and others can change to ieratorcoagent; coagentcoagent
coagent.wrap return a promise and each iterator next return is considered an item of an array;
Options
pool
: concurrency exec max length;
safe
: false one async exec error return promise rejected, true just this return data is null;
timeout
: every async exec timeout setting
License
MIT