MCPcopy
hub / github.com/Effect-TS/effect / offerRemainingArray

Method offerRemainingArray

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

Source from the content-addressed store, hash-verified

350 })
351 }
352 private offerRemainingArray(remaining: Array<A>) {
353 return core.asyncInterrupt<Chunk.Chunk<A>>((resume) => {
354 if (this.state._tag !== "Open") {
355 return resume(core.exitSucceed(Chunk.unsafeFromArray(remaining)))
356 }
357 const entry: OfferEntry<A> = { _tag: "Array", remaining, offset: 0, resume }
358 this.state.offers.add(entry)
359 return core.sync(() => {
360 if (this.state._tag === "Open") {
361 this.state.offers.delete(entry)
362 }
363 })
364 })
365 }
366 private releaseCapacity(): boolean {
367 if (this.state._tag === "Done") {
368 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