(message: A)
| 111 | }) |
| 112 | } |
| 113 | unsafeOffer(message: A): boolean { |
| 114 | if (this.state._tag !== "Open") { |
| 115 | return false |
| 116 | } else if (this.messages.length + this.messagesChunk.length >= this.capacity) { |
| 117 | if (this.strategy === "sliding") { |
| 118 | this.unsafeTake() |
| 119 | this.messages.push(message) |
| 120 | return true |
| 121 | } else if (this.capacity <= 0 && this.state.takers.size > 0) { |
| 122 | this.messages.push(message) |
| 123 | this.releaseTaker() |
| 124 | return true |
| 125 | } |
| 126 | return false |
| 127 | } |
| 128 | this.messages.push(message) |
| 129 | this.scheduleReleaseTaker() |
| 130 | return true |
| 131 | } |
| 132 | offerAll(messages: Iterable<A>): Effect<Chunk.Chunk<A>> { |
| 133 | return core.suspend(() => { |
| 134 | if (this.state._tag !== "Open") { |
nothing calls this directly
no test coverage detected