()
| 8704 | } |
| 8705 | |
| 8706 | async next() { |
| 8707 | this.stream.setConsumer(this.id, this); |
| 8708 | |
| 8709 | while (true) { |
| 8710 | if (!this.currentNode.next) { |
| 8711 | try { |
| 8712 | await this._waitForNextItem(this.timeout); |
| 8713 | } catch (error) { |
| 8714 | this._destroy(); |
| 8715 | throw error; |
| 8716 | } |
| 8717 | } |
| 8718 | if (this._killPacket) { |
| 8719 | this._destroy(); |
| 8720 | let killPacket = this._killPacket; |
| 8721 | delete this._killPacket; |
| 8722 | |
| 8723 | return killPacket; |
| 8724 | } |
| 8725 | |
| 8726 | this.currentNode = this.currentNode.next; |
| 8727 | this.releaseBackpressure(this.currentNode.data); |
| 8728 | |
| 8729 | if (this.currentNode.consumerId && this.currentNode.consumerId !== this.id) { |
| 8730 | continue; |
| 8731 | } |
| 8732 | |
| 8733 | if (this.currentNode.data.done) { |
| 8734 | this._destroy(); |
| 8735 | } |
| 8736 | |
| 8737 | return this.currentNode.data; |
| 8738 | } |
| 8739 | } |
| 8740 | |
| 8741 | return() { |
| 8742 | delete this.currentNode; |
no test coverage detected