effect-fiber

Fork, supervise, and interrupt Effect fibers using FiberHandle, FiberMap, and FiberSet.

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-fiber-lambdasolver2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-fiber
Source: https://github.com/lambdasolver2/opencode-effect-harness/tree/main/packages/module-typescript/assets/skills/effect-fiber
Command: npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-fiber-lambdasolver2

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires effect.

What problem does it solve? Managing concurrent background work in Effect v4 requires choosing the right fork variant, handling cooperative interruption, and supervising fiber lifetimes — mistakes like fire-and-forget with forkChild silently kill work or leak failures. ## Core Features & Use Cases - Forking and lifetime control: Covers Effect.forkChild, forkScoped, forkIn, and forkDetach with startImmediately and uninterruptible options, plus join/await/Exit inspection. - Supervision collections: Documents FiberHandle (latest-wins single slot), FiberMap (keyed fibers with dedupe), and FiberSet (grow-only sets with graceful drain), including runtime runners for callback APIs. - Interruption and cleanup: Explains uninterruptibleMask regions, onInterrupt/onExit/ensuring finalizers, AbortSignal bridging, and runMain keep-alive behavior. - Use Case: Build an autocomplete search box where each keystroke interrupts the in-flight search via FiberHandle.runtime, or a webhook processor that drains in-flight tasks gracefully on shutdown with FiberSet.awaitEmpty. ## Quick Start Ask the assistant to implement a keyed job runner in Effect v4 that dedupes concurrent downloads per URL and cancels them on demand using FiberMap.

Frequently Asked Questions about effect-fiber

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fork a background fiber in Effect v4?

Use Effect.forkChild to attach a fiber to the parent, Effect.forkScoped or Effect.forkIn to tie it to a Scope, or Effect.forkDetach for fully detached work. The v3 names Effect.fork and Effect.forkDaemon no longer exist in v4.

What is the difference between FiberHandle, FiberMap, and FiberSet?

FiberHandle supervises at most one fiber with latest-wins replacement, FiberMap manages keyed fibers where a new run under an existing key interrupts the previous one, and FiberSet is a grow-only collection with no replacement semantics. All three interrupt their fibers when the owning scope closes.

Why does my forked fiber get interrupted before it finishes?

Fibers forked with Effect.forkChild are interrupted when the parent fiber completes, so fire-and-forget children die early. Use forkScoped for scope-tied work, forkDetach for detached work, or Effect.awaitAllChildren to wait for children.

Does Fiber.await fail when the fiber fails?

No, Fiber.await always succeeds and returns the fiber's Exit for inspection. Use Fiber.join to propagate the fiber's failure into the current fiber, or inspect the Exit with Exit.isSuccess and Cause helpers.

How do I cancel an in-flight Effect task when a new request arrives?

Run each task through a FiberHandle, which interrupts the previous fiber whenever a new effect is run into it. FiberHandle.runtime returns a synchronous runner function suitable for event handlers like input listeners.

Why is my Effect.runFork process exiting immediately in Node.js?

A bare runFork fiber suspended on a pure Effect primitive does not keep the Node.js process alive, since per-fiber keep-alive was removed from the core runtime. Use NodeRuntime.runMain, which installs a keep-alive timer plus SIGINT/SIGTERM handling and exit-code mapping.