diff options
| author | Tom Harley | 2018-04-26 05:05:49 +0100 |
|---|---|---|
| committer | Tom Harley | 2018-04-26 05:05:49 +0100 |
| commit | f0331e27eab9e699529183b0dc2dd1bc9599aea5 (patch) | |
| tree | c7c09b1d77006bf7aceb7c3bf1c23910c9a55168 /src/ppq | |
| parent | Miscellaneous minor fixes (diff) | |
| parent | pushing for tom to get changes (diff) | |
| download | medicine-f0331e27eab9e699529183b0dc2dd1bc9599aea5.tar.gz medicine-f0331e27eab9e699529183b0dc2dd1bc9599aea5.zip | |
Merge branch ‘trh/gets’ of gitlab.cs.st-andrews.ac.uk:cs3099group-be-4/project-code into trh/gets
Diffstat (limited to 'src/ppq')
| -rw-r--r-- | src/ppq/index.js | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/ppq/index.js b/src/ppq/index.js index ec2f188..84d2b7e 100644 --- a/src/ppq/index.js +++ b/src/ppq/index.js @@ -19,23 +19,23 @@ class PromisePriorityQueue { if (config.concurrent) this.concurrent = config.concurrent; } - // enqueue(i, p, t, ...args) { - // return p.bind(t)(...args); - // } - - enqueue(i, p, t, ...argv) { - this.size++; - return new Promise((res, rej) => { - this.queues[i-1].push( - [ - p.bind(t, ...argv), - res, - rej - ] - ); - this.run(); - }); - }; + enqueue(i, p, t, ...args) { + return p.bind(t)(...args); + } + + // enqueue(i, p, t, ...argv) { + // this.size++; + // return new Promise((res, rej) => { + // this.queues[i-1].push( + // [ + // p.bind(t, ...argv), + // res, + // rej + // ] + // ); + // this.run(); + // }); + // }; dequeue() { for (let i = 0; i < this.least; ++i) { |
