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

Method subscribe

packages/effect/src/internal/pubsub.ts:1231–1243  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1229 }
1230
1231 get subscribe(): Effect.Effect<Queue.Dequeue<A>, never, Scope.Scope> {
1232 const acquire = core.tap(
1233 fiberRuntime.all([
1234 this.scope.fork(executionStrategy.sequential),
1235 makeSubscription(this.pubsub, this.subscribers, this.strategy)
1236 ]),
1237 (tuple) => tuple[0].addFinalizer(() => tuple[1].shutdown)
1238 )
1239 return core.map(
1240 fiberRuntime.acquireRelease(acquire, (tuple, exit) => tuple[0].close(exit)),
1241 (tuple) => tuple[1]
1242 )
1243 }
1244
1245 offer(value: A): Effect.Effect<boolean> {
1246 return this.publish(value)

Callers

nothing calls this directly

Calls 5

makeSubscriptionFunction · 0.70
forkMethod · 0.65
addFinalizerMethod · 0.65
mapMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected