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