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

Function runFiber

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

Source from the content-addressed store, hash-verified

2244 return exits
2245 }
2246 const runFiber = <A, E, R>(eff: Effect.Effect<A, E, R>, interruptImmediately = false) => {
2247 const runnable = core.uninterruptible(graft(eff))
2248 const fiber = unsafeForkUnstarted(
2249 runnable,
2250 parent,
2251 parent.currentRuntimeFlags,
2252 fiberScope.globalScope
2253 )
2254 parent.currentScheduler.scheduleTask(
2255 () => {
2256 if (interruptImmediately) {
2257 fiber.unsafeInterruptAsFork(parent.id())
2258 }
2259 fiber.resume(runnable)
2260 },
2261 0,
2262 fiber
2263 )
2264 return fiber
2265 }
2266 const onInterruptSignal = () => {
2267 if (!processAll) {
2268 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