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

Method publish

packages/effect/src/internal/pubsub.ts:1175–1193  ·  view source on GitHub ↗
(value: A)

Source from the content-addressed store, hash-verified

1173 }
1174
1175 publish(value: A): Effect.Effect<boolean> {
1176 return core.suspend(() => {
1177 if (MutableRef.get(this.shutdownFlag)) {
1178 return core.interrupt
1179 }
1180
1181 if (this.pubsub.publish(value)) {
1182 this.strategy.unsafeCompleteSubscribers(this.pubsub, this.subscribers)
1183 return core.succeed(true)
1184 }
1185
1186 return this.strategy.handleSurplus(
1187 this.pubsub,
1188 this.subscribers,
1189 Chunk.of(value),
1190 this.shutdownFlag
1191 )
1192 })
1193 }
1194
1195 isActive(): boolean {
1196 return !MutableRef.get(this.shutdownFlag)

Callers 1

offerMethod · 0.95

Calls 5

getMethod · 0.65
publishMethod · 0.65
handleSurplusMethod · 0.65
ofMethod · 0.65

Tested by

no test coverage detected