| 336 | } |
| 337 | |
| 338 | private offerRemainingSingle(message: A) { |
| 339 | return core.asyncInterrupt<boolean>((resume) => { |
| 340 | if (this.state._tag !== "Open") { |
| 341 | return resume(exitFalse) |
| 342 | } |
| 343 | const entry: OfferEntry<A> = { _tag: "Single", message, resume } |
| 344 | this.state.offers.add(entry) |
| 345 | return core.sync(() => { |
| 346 | if (this.state._tag === "Open") { |
| 347 | this.state.offers.delete(entry) |
| 348 | } |
| 349 | }) |
| 350 | }) |
| 351 | } |
| 352 | private offerRemainingArray(remaining: Array<A>) { |
| 353 | return core.asyncInterrupt<Chunk.Chunk<A>>((resume) => { |
| 354 | if (this.state._tag !== "Open") { |