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

Function bounded

packages/effect/src/TxPubSub.ts:128–133  ·  view source on GitHub ↗
(capacity: number)

Source from the content-addressed store, hash-verified

126 * @since 2.0.0
127 */
128export const bounded = <A = never>(capacity: number): Effect.Effect<TxPubSub<A>> =>
129 Effect.gen(function*() {
130 const subscribersRef = yield* TxRef.make<Array<TxQueue.TxQueue<A>>>([])
131 const shutdownRef = yield* TxRef.make(false)
132 return makeTxPubSub(subscribersRef, shutdownRef, "bounded", capacity)
133 }).pipe(Effect.tx)
134
135/**
136 * Creates a dropping TxPubSub with the specified capacity. When a subscriber's

Callers

nothing calls this directly

Calls 3

makeTxPubSubFunction · 0.85
pipeMethod · 0.65
makeMethod · 0.65

Tested by

no test coverage detected