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

Function fromQueue

packages/effect/src/internal/sink.ts:1477–1490  ·  view source on GitHub ↗
(
  queue: Queue.Enqueue<In>,
  options?: {
    readonly shutdown?: boolean | undefined
  }
)

Source from the content-addressed store, hash-verified

1475
1476/** @internal */
1477export const fromQueue = <In>(
1478 queue: Queue.Enqueue<In>,
1479 options?: {
1480 readonly shutdown?: boolean | undefined
1481 }
1482): Sink.Sink<void, In> =>
1483 options?.shutdown ?
1484 unwrapScoped(
1485 Effect.map(
1486 Effect.acquireRelease(Effect.succeed(queue), Queue.shutdown),
1487 fromQueue
1488 )
1489 ) :
1490 forEachChunk((input: Chunk.Chunk<In>) => Queue.offerAll(queue, input))
1491
1492/** @internal */
1493export const head = <In>(): Sink.Sink<Option.Option<In>, In, In> =>

Callers 1

fromPubSubFunction · 0.70

Calls 4

forEachChunkFunction · 0.85
unwrapScopedFunction · 0.70
mapMethod · 0.65
offerAllMethod · 0.65

Tested by

no test coverage detected