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

Function bounded

packages/effect/src/TxQueue.ts:357–370  ·  view source on GitHub ↗
(
  capacity: number
)

Source from the content-addressed store, hash-verified

355 * @since 2.0.0
356 */
357export const bounded = <A = never, E = never>(
358 capacity: number
359): Effect.Effect<TxQueue<A, E>> =>
360 Effect.gen(function*() {
361 const items = yield* TxChunk.empty<A>()
362 const stateRef = yield* TxRef.make<State<A, E>>({ _tag: "Open" })
363
364 const txQueue = Object.create(TxQueueProto)
365 txQueue.strategy = "bounded"
366 txQueue.capacity = capacity
367 txQueue.items = items
368 txQueue.stateRef = stateRef
369 return txQueue
370 }).pipe(Effect.tx)
371
372/**
373 * Creates a new unbounded `TxQueue` with unlimited capacity.

Callers

nothing calls this directly

Calls 2

pipeMethod · 0.65
makeMethod · 0.65

Tested by

no test coverage detected