Files
sean 343b4a3f3f
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-19 18:32:17 -05:00

16 lines
329 B
JavaScript

"use strict";
module.exports = consume;
function consume(channel, emit) {
return function (callback) {
channel.take(onItem);
function onItem(err, item) {
if (item === undefined) return callback(err);
try { emit(item); }
catch (err) { return callback(err); }
channel.take(onItem);
}
};
}