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

Function runtime

packages/effect/src/FiberSet.ts:564–583  ·  view source on GitHub ↗
(self: FiberSet<A, E>)

Source from the content-addressed store, hash-verified

562 never,
563 R
564> = <A, E>(self: FiberSet<A, E>) => <R>() =>
565 Effect.map(
566 Effect.context<R>(),
567 (services) => {
568 const runFork = Effect.runForkWith(services)
569 return <XE extends E, XA extends A>(
570 effect: Effect.Effect<XA, XE, R>,
571 options?:
572 | Effect.RunOptions & { readonly propagateInterruption?: boolean | undefined }
573 | undefined
574 ) => {
575 if (self.state._tag === "Closed") {
576 return constInterruptedFiber()
577 }
578 const fiber = runFork(effect, options)
579 addUnsafe(self, fiber, options)
580 return fiber
581 }
582 }
583 )
584
585/**
586 * Captures a `Runtime` and returns a Promise-based runner that forks effects

Callers 2

makeRuntimeFunction · 0.70
runtimePromiseFunction · 0.70

Calls 4

runForkFunction · 0.85
addUnsafeFunction · 0.85
contextMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected