MCPcopy Create free account
hub / github.com/Effect-TS/effect / offerRemainingArray

Method offerRemainingArray

packages/effect/src/internal/mailbox.ts:357–370  ·  view source on GitHub ↗
(remaining: Array<A>)

Source from the content-addressed store, hash-verified

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"

Callers 1

offerAllMethod · 0.95

Calls 3

syncMethod · 0.80
resumeFunction · 0.70
addMethod · 0.65

Tested by

no test coverage detected