MCPcopy Index your code
hub / github.com/bee-queue/bee-queue / reef

Function reef

benchmark/bq/harness.js:18–30  ·  view source on GitHub ↗
(n = 1)

Source from the content-addressed store, hash-verified

16
17// A promise-based barrier.
18function reef(n = 1) {
19 const done = helpers.deferred(),
20 end = done.defer();
21 return {
22 done,
23 next() {
24 --n;
25 if (n < 0) return false;
26 if (n === 0) end();
27 return true;
28 },
29 };
30}
31
32module.exports = (options) => {
33 return new Promise((resolve) => {

Callers 1

harness.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected