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

Function callbackArray

packages/effect/src/Channel.ts:525–532  ·  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

523 * @since 4.0.0
524 */
525export const callbackArray = <A, E = never, R = never>(
526 f: (queue: Queue.Queue<A, E | Cause.Done>) => Effect.Effect<unknown, E, R | Scope.Scope>,
527 options?: {
528 readonly bufferSize?: number | undefined
529 readonly strategy?: "sliding" | "dropping" | "suspend" | undefined
530 }
531): Channel<Arr.NonEmptyReadonlyArray<A>, E, void, unknown, unknown, unknown, Exclude<R, Scope.Scope>> =>
532 fromTransform((_, scope) => Effect.map(asyncQueue(scope, f, options), Queue.takeAll))
533
534/**
535 * Creates a `Channel` that lazily evaluates to another channel.

Callers

nothing calls this directly

Calls 3

asyncQueueFunction · 0.85
fromTransformFunction · 0.70
mapMethod · 0.45

Tested by

no test coverage detected