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

Function makeRuntime

packages/effect/src/FiberHandle.ts:196–214  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

194 * @since 2.0.0
195 */
196export const makeRuntime = <R, E = unknown, A = unknown>(): Effect.Effect<
197 <XE extends E, XA extends A>(
198 effect: Effect.Effect<XA, XE, R>,
199 options?:
200 | {
201 readonly signal?: AbortSignal | undefined
202 readonly scheduler?: Scheduler | undefined
203 readonly onlyIfMissing?: boolean | undefined
204 readonly propagateInterruption?: boolean | undefined
205 }
206 | undefined
207 ) => Fiber.Fiber<XA, XE>,
208 never,
209 Scope.Scope | R
210> =>
211 Effect.flatMap(
212 make<A, E>(),
213 (self) => runtime(self)<R>()
214 )
215
216/**
217 * Creates a scoped run function that forks effects into a new `FiberHandle`

Callers

nothing calls this directly

Calls 2

makeFunction · 0.70
runtimeFunction · 0.70

Tested by

no test coverage detected