ordered-regions
v1.1.0
Published
submit out of order data and receive that data ordered sequentially and/or in blocks
Downloads
5
Maintainers
Readme
ordered-regions
submit out of order objects and receive that data ordered sequentially and/or in groups
install
$ npm install ordered-regions
usage
const OrderedRegions = require("../ordered-regions");
const TOTAL = 32;
const or = OrderedRegions({
total: TOTAL,
groups: 8
});
or.onEach((item) => {
console.log('item recevied in order');
});
or.onGroup((items) => {
console.log('ordered group of items recevied');
});
or.onComplete(() => {
console.log('finished ordering items');
});
for (let i = TOTAL; i >= 0; i--) {
or.submit({id: i});
}