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

Function runtime

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

Source from the content-addressed store, hash-verified

612 never,
613 R
614> = <A, E>(self: FiberSet<A, E>) => <R>() =>
615 Effect.map(
616 Effect.context<R>(),
617 (services) => {
618 const runFork = Effect.runForkWith(services)
619 return <XE extends E, XA extends A>(
620 effect: Effect.Effect<XA, XE, R>,
621 options?:
622 | Effect.RunOptions & { readonly propagateInterruption?: boolean | undefined }
623 | undefined
624 ) => {
625 if (self.state._tag === "Closed") {
626 return constInterruptedFiber()
627 }
628 const fiber = runFork(effect, options)
629 addUnsafe(self, fiber, options)
630 return fiber
631 }
632 }
633 )
634
635/**
636 * 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