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

Method addObserver

packages/effect/src/internal/effect.ts:560–572  ·  view source on GitHub ↗
(cb: (exit: Exit.Exit<A, E>) => void)

Source from the content-addressed store, hash-verified

558 return Context.get(this.context, ref)
559 }
560 addObserver(cb: (exit: Exit.Exit<A, E>) => void): () => void {
561 if (this._exit) {
562 cb(this._exit)
563 return constVoid
564 }
565 this._observers.push(cb)
566 return () => {
567 const index = this._observers.indexOf(cb)
568 if (index >= 0) {
569 this._observers.splice(index, 1)
570 }
571 }
572 }
573 interruptUnsafe(fiberId?: number | undefined, annotations?: Context.Context<never> | undefined): void {
574 if (this._exit) {
575 return

Callers 15

onMessageFunction · 0.80
layerFunction · 0.80
NodeRuntime.tsFile · 0.80
constructorMethod · 0.80
_destroyMethod · 0.80
DenoRuntime.tsFile · 0.80
onMessageFunction · 0.80
onMessageFunction · 0.80
onMessageFunction · 0.80
getFunction · 0.80
makeRunMainFunction · 0.80

Calls 1

pushMethod · 0.80

Tested by 1

getFunction · 0.64