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

Function dropping

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

Source from the content-addressed store, hash-verified

164 * @since 2.0.0
165 */
166export const dropping = <A = never>(capacity: number): Effect.Effect<TxPubSub<A>> =>
167 Effect.gen(function*() {
168 const subscribersRef = yield* TxRef.make<Array<TxQueue.TxQueue<A>>>([])
169 const shutdownRef = yield* TxRef.make(false)
170 return makeTxPubSub(subscribersRef, shutdownRef, "dropping", capacity)
171 }).pipe(Effect.tx)
172
173/**
174 * Creates a sliding 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