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

Method publishAll

packages/effect/src/internal/pubsub.ts:1212–1229  ·  view source on GitHub ↗
(elements: Iterable<A>)

Source from the content-addressed store, hash-verified

1210 }
1211
1212 publishAll(elements: Iterable<A>): Effect.Effect<boolean> {
1213 return core.suspend(() => {
1214 if (MutableRef.get(this.shutdownFlag)) {
1215 return core.interrupt
1216 }
1217 const surplus = unsafePublishAll(this.pubsub, elements)
1218 this.strategy.unsafeCompleteSubscribers(this.pubsub, this.subscribers)
1219 if (Chunk.isEmpty(surplus)) {
1220 return core.succeed(true)
1221 }
1222 return this.strategy.handleSurplus(
1223 this.pubsub,
1224 this.subscribers,
1225 surplus,
1226 this.shutdownFlag
1227 )
1228 })
1229 }
1230
1231 get subscribe(): Effect.Effect<Queue.Dequeue<A>, never, Scope.Scope> {
1232 const acquire = core.tap(

Callers 1

offerAllMethod · 0.95

Calls 5

unsafePublishAllFunction · 0.85
getMethod · 0.65
isEmptyMethod · 0.65
handleSurplusMethod · 0.65

Tested by

no test coverage detected