mcollina / fastq

Fast, in memory work queue
ISC License
943 stars 47 forks source link

Support for batch-wise queueing #33

Closed kamikazechaser closed 3 years ago

kamikazechaser commented 3 years ago

fastq is API compatible with async.queue

Async queue, supports batch-wise processing. i.e.

const { queue } = require("async");

const q = queue(function (task, callback) {
  console.log(2 * task);
  callback();
}, 1);

// accepts array as arg for batchwise processing
q.push([2, 3, 4], function (err) {
  console.log("finished processing item");
});

Ref: https://github.com/caolan/async/blob/master/lib/internal/queue.js#L159

mcollina commented 3 years ago

Oh, that's kind of new. I'll remove the statement from the README then.

kamikazechaser commented 3 years ago

Sounds fair, adding some looping logic would probably remove the fast from fastq :grinning:.

mcollina commented 3 years ago

No, not really. The key problem is that we won't be able to pass arrays anymore as tasks to process. I think that's a feature worth preserving.