3.2.0 • Published 3 months ago

maximize-iterator v3.2.0

Weekly downloads
16
License
MIT
Repository
github
Last release
3 months ago

maximize-iterator

Maximize the parallel calls of an iterator supporting asyncIterator interface.

const maximize = require('maximize-iterator');

(async ()=> {
  // run 1024 in parallel until done - promises
  var iterator = // create it somehow with a next method returing {done: value: }
  await maximize(iterator, (value) => { /* do something including false stop */ }, { concurrency: 1024, limit: Infinity, error: (err) => { return true; /* filter errors */ } });
})();

// run 1024 in parallel until done - callbacks
var iterator = // create it somehow with a next method returing {done: value: }
maximize(iterator, (value) => { /* do something including false stop */ }, { concurrency: 1024, limit: Infinity,  error: (err) => { return true; /* filter errors */ } }, (err) => {
  /* done */
});

forEach Options:

  • bool: callbacks - use an each function with a callback function(entry, callback) (default: false)
  • number: concurrency - parallelism of processing. (default: Infinity)
  • number: limit - maximum number to process. (default: Infinity)
  • number: batch - per batch count to limit expansion. (default: 10)
3.2.0

3 months ago

3.1.0

3 months ago

3.0.0

3 months ago

2.6.6

2 years ago

2.6.5

4 years ago

2.6.4

4 years ago

2.6.2

4 years ago

2.6.1

4 years ago

2.6.0

4 years ago

2.5.0

4 years ago

2.5.1

4 years ago

2.4.0

4 years ago

2.3.0

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago