MCPcopy Index your code
hub / github.com/Effect-TS/effect / takeUpTo

Method takeUpTo

packages/effect/src/internal/queue.ts:282–292  ·  view source on GitHub ↗
(max: number)

Source from the content-addressed store, hash-verified

280 }
281
282 takeUpTo(max: number): Effect.Effect<Chunk.Chunk<A>> {
283 return core.suspend(() =>
284 MutableRef.get(this.shutdownFlag)
285 ? core.interrupt
286 : core.sync(() => {
287 const values = this.queue.pollUpTo(max)
288 this.strategy.unsafeOnQueueEmptySpace(this.queue, this.takers)
289 return Chunk.fromIterable(values)
290 })
291 )
292 }
293
294 takeBetween(min: number, max: number): Effect.Effect<Chunk.Chunk<A>> {
295 return core.suspend(() =>

Callers

nothing calls this directly

Calls 4

syncMethod · 0.80
getMethod · 0.65
pollUpToMethod · 0.65

Tested by

no test coverage detected