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

Function callback

repos/effect/packages/effect/src/Channel.ts:483–490  ·  view source on GitHub ↗
(
  f: (queue: Queue.Queue<A, E | Cause.Done>) => Effect.Effect<unknown, E, R | Scope.Scope>,
  options?: {
    readonly bufferSize?: number | undefined
    readonly strategy?: "sliding" | "dropping" | "suspend" | undefined
  }
)

Source from the content-addressed store, hash-verified

481 * import { Channel, Effect, Queue } from "effect"
482 *
483 * const channel = Channel.callback<number>((queue) =>
484 * Effect.gen(function*() {
485 * yield* Queue.offer(queue, 1)
486 * yield* Queue.offer(queue, 2)
487 * yield* Queue.offer(queue, 3)
488 * yield* Queue.end(queue)
489 * })
490 * )
491 * await Effect.runPromise(Channel.runCollect(channel)) // => [1, 2, 3]
492 * ```
493 *

Callers

nothing calls this directly

Calls 3

asyncQueueFunction · 0.85
fromTransformFunction · 0.70
mapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…