MCPcopy Create free account
hub / github.com/effect-app/libs / takeBetween

Function takeBetween

repos/effect/packages/effect/src/Queue.ts:1346–1353  ·  view source on GitHub ↗
(
  self: Dequeue<A, E>,
  min: number,
  max: number
)

Source from the content-addressed store, hash-verified

1344 * **Example** (Taking a bounded batch of values)
1345 *
1346 * ```ts import.meta.vitest
1347 * import { Cause, Effect, Queue } from "effect"
1348 *
1349 * const program = Effect.gen(function*() {
1350 * const queue = yield* Queue.bounded<number>(10)
1351 *
1352 * // Add several messages
1353 * yield* Queue.offerAll(queue, [1, 2, 3, 4, 5, 6, 7, 8])
1354 *
1355 * // Take between 2 and 5 messages
1356 * const batch1 = yield* Queue.takeBetween(queue, 2, 5)

Callers 2

takeAllFunction · 0.85
takeNFunction · 0.85

Calls 2

takeBetweenUnsafeFunction · 0.85
awaitTakeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…