(self: Dequeue<A, E>, min: number)
| 2075 | // Whether a take of at least `min` messages can complete without waiting. |
| 2076 | // A closing queue receives no more messages, so any remainder satisfies `min`. |
| 2077 | const canTake = <A, E>(self: Dequeue<A, E>, min: number): boolean => |
| 2078 | self.messages.length >= (self.state._tag === "Closing" ? 1 : Math.min(min, self.capacity || 1)) || |
| 2079 | (self.capacity <= 0 && self.state._tag !== "Done" && self.state.offers.size > 0) |
| 2080 | |
| 2081 | // The readiness check and the taker registration run in one step, so no |
| 2082 | // message can arrive between them. Wake-ups resume with void and the caller |
no outgoing calls
no test coverage detected