Hyperlinkv0.8.0-beta.28

Fiber

Fiber.runInconsteffect/Fiber.ts:629
(scope: Scope): <A, E>(self: Fiber<A, E>) => Fiber<A, E>
<A, E>(self: Fiber<A, E>, scope: Scope): Fiber<A, E>

Adds a fiber to a Scope and returns the same fiber.

When to use

Use when a manually managed fiber should be interrupted when a Scope closes.

Details

When the scope is closed, the fiber is interrupted. If the scope is already closed, the fiber is interrupted immediately.

Gotchas

This does not wait for the fiber to complete. It only registers the interruption finalizer and returns the same fiber.

resource managementinterrupt
Source effect/Fiber.ts:6294 lines
export const runIn: {
  (scope: Scope): <A, E>(self: Fiber<A, E>) => Fiber<A, E>
  <A, E>(self: Fiber<A, E>, scope: Scope): Fiber<A, E>
} = effect.fiberRunIn
Referenced by 5 symbols