MCPcopy
hub / github.com/Effect-TS/effect / runFiber

Function runFiber

packages/effect/src/internal/fiberRuntime.ts:2236–2255  ·  view source on GitHub ↗
(eff: Effect.Effect<A, E, R>, interruptImmediately = false)

Source from the content-addressed store, hash-verified

2234 return exits
2235 }
2236 const runFiber = <A, E, R>(eff: Effect.Effect<A, E, R>, interruptImmediately = false) => {
2237 const runnable = core.uninterruptible(graft(eff))
2238 const fiber = unsafeForkUnstarted(
2239 runnable,
2240 parent,
2241 parent.currentRuntimeFlags,
2242 fiberScope.globalScope
2243 )
2244 parent.currentScheduler.scheduleTask(
2245 () => {
2246 if (interruptImmediately) {
2247 fiber.unsafeInterruptAsFork(parent.id())
2248 }
2249 fiber.resume(runnable)
2250 },
2251 0,
2252 fiber
2253 )
2254 return fiber
2255 }
2256 const onInterruptSignal = () => {
2257 if (!processAll) {
2258 target -= todos.length

Callers 2

forEachConcurrentDiscardFunction · 0.85
nextFunction · 0.85

Calls 5

unsafeForkUnstartedFunction · 0.85
resumeMethod · 0.80
scheduleTaskMethod · 0.65
unsafeInterruptAsForkMethod · 0.65
idMethod · 0.65

Tested by

no test coverage detected