| 355 | }) |
| 356 | } |
| 357 | private offerRemainingArray(remaining: Array<A>) { |
| 358 | return core.asyncInterrupt<Chunk.Chunk<A>>((resume) => { |
| 359 | if (this.state._tag !== "Open") { |
| 360 | return resume(core.exitSucceed(Chunk.unsafeFromArray(remaining))) |
| 361 | } |
| 362 | const entry: OfferEntry<A> = { _tag: "Array", remaining, offset: 0, resume } |
| 363 | this.state.offers.add(entry) |
| 364 | return core.sync(() => { |
| 365 | if (this.state._tag === "Open") { |
| 366 | this.state.offers.delete(entry) |
| 367 | } |
| 368 | }) |
| 369 | }) |
| 370 | } |
| 371 | private releaseCapacity(): boolean { |
| 372 | if (this.state._tag === "Done") { |
| 373 | return this.state.exit._tag === "Success" |