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

Method await

packages/effect/src/internal/fiberRuntime.ts:451–475  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

449 }
450
451 get await(): Effect.Effect<Exit.Exit<A, E>> {
452 return core.async((resume) => {
453 const cb = (exit: Exit.Exit<A, E>) => resume(core.succeed(exit))
454 if (this._exitValue !== null) {
455 cb(this._exitValue!)
456 return
457 }
458 this.tell(
459 FiberMessage.stateful((fiber, _) => {
460 if (fiber._exitValue !== null) {
461 cb(this._exitValue!)
462 } else {
463 fiber.addObserver(cb)
464 }
465 })
466 )
467 return core.sync(() =>
468 this.tell(
469 FiberMessage.stateful((fiber, _) => {
470 fiber.removeObserver(cb)
471 })
472 )
473 )
474 }, this.id())
475 }
476
477 get inheritAll(): Effect.Effect<void> {
478 return core.withFiberRuntime((parentFiber, parentStatus) => {

Callers 15

joinFunction · 0.45
FiberSet.tsFile · 0.45
joinFunction · 0.45
FiberHandle.tsFile · 0.45
joinFunction · 0.45
FiberMap.tsFile · 0.45
refreshMethod · 0.45
resolveMapValueMethod · 0.45
groupBy.tsFile · 0.45
terminateFunction · 0.45
stream.tsFile · 0.45
raceAllFunction · 0.45

Calls 5

tellMethod · 0.95
idMethod · 0.95
syncMethod · 0.80
addObserverMethod · 0.65
removeObserverMethod · 0.65

Tested by

no test coverage detected