()
| 33 | } |
| 34 | |
| 35 | async pop(): Promise<T> { |
| 36 | const shiftedItem = this.queue.shift(); |
| 37 | if (shiftedItem !== undefined) { |
| 38 | return shiftedItem; |
| 39 | } else { |
| 40 | return new Promise<T>((resolve) => { |
| 41 | this.resolveWaitingPop = resolve; |
| 42 | }); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | clear() { |
| 47 | const oldQueue = this.queue; |
no outgoing calls
no test coverage detected