MCPcopy
hub / github.com/Effect-TS/effect / subscriber

Function subscriber

packages/effect/test/TSubscriptionRef.test.ts:129–139  ·  view source on GitHub ↗
(subscriptionRef: TSubscriptionRef.TSubscriptionRef<number>)

Source from the content-addressed store, hash-verified

127 it.effect("concurrent subscribes and unsubscribes are handled correctly", () =>
128 Effect.gen(function*() {
129 const subscriber = (subscriptionRef: TSubscriptionRef.TSubscriptionRef<number>) =>
130 pipe(
131 Random.nextIntBetween(0, 200),
132 Effect.flatMap((n) =>
133 pipe(
134 TSubscriptionRef.changesStream(subscriptionRef),
135 Stream.take(n),
136 Stream.runCollect
137 )
138 )
139 )
140 const ref = yield* (TSubscriptionRef.make(0))
141 const fiber = yield* pipe(
142 TSubscriptionRef.update(ref, (n) => n + 1),

Callers 1

Calls 3

pipeFunction · 0.90
nextIntBetweenMethod · 0.65
takeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…