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

Function runtime

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

Source from the content-addressed store, hash-verified

389 never,
390 R
391> = <A, E>(self: FiberSet<A, E>) => <R>() =>
392 Effect.map(
393 Effect.runtime<R>(),
394 (runtime) => {
395 const runFork = Runtime.runFork(runtime)
396 return <XE extends E, XA extends A>(
397 effect: Effect.Effect<XA, XE, R>,
398 options?:
399 | Runtime.RunForkOptions & { readonly propagateInterruption?: boolean | undefined }
400 | undefined
401 ) => {
402 if (self.state._tag === "Closed") {
403 return constInterruptedFiber()
404 }
405 const fiber = runFork(effect, options)
406 unsafeAdd(self, fiber)
407 return fiber
408 }
409 }
410 )
411
412/**
413 * Capture a Runtime and use it to fork Effect's, adding the forked fibers to the FiberSet.

Callers 2

makeRuntimeFunction · 0.70
runtimePromiseFunction · 0.70

Calls 3

runtimeMethod · 0.80
runForkFunction · 0.70
mapMethod · 0.65

Tested by

no test coverage detected