* Enqueue one item and resolve only after the consumer has fully processed * that exact sequence. Unlike `push()`, an enqueue rejected by queue state is * observable by the producer.
(item: T)
| 50 | * observable by the producer. |
| 51 | */ |
| 52 | pushAndWaitUntilConsumed(item: T): Promise<void> { |
| 53 | if (this.err) return Promise.reject(this.err); |
| 54 | if (this.consumerDetached) return Promise.reject(consumerDetachedError()); |
| 55 | if (this.closed) return Promise.reject(queueClosedError()); |
| 56 | const sequence = this.enqueue(item); |
| 57 | return this.waitUntilConsumed(sequence); |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Wait through the producer boundary captured at call time. Items enqueued |
nothing calls this directly
no test coverage detected