eio

Coordinate OCaml concurrent workflows with Eio fibers, switches, and resource lifecycles.

26|5|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/avsm/oxmono --skill eio-avsm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: eio
Source: https://github.com/avsm/oxmono/tree/main/.claude/skills/eio
Command: npx skills add https://github.com/avsm/oxmono --skill eio-avsm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Eio concurrency patterns address the challenge of writing structured, safe, and scalable asynchronous OCaml code by providing explicit resource handling, cancellation, and fiber orchestration.

Core Features & Use Cases

  • Structured concurrency with switches to manage lifecycles and deterministic cleanup
  • Primitives for file, network, and time operations with explicit capabilities
  • Testing and mocking support via Eio_mock for deterministic tests
  • Integration patterns with cohttp-eio and bytesrw for streaming and HTTP clients
  • Real-world use cases including parallel data processing, resilient servers, and streaming pipelines

Quick Start

Launch an OCaml program that uses Eio to orchestrate fibers, switches, and network I/O with structured concurrency.

Frequently Asked Questions about eio

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

FAQPage Schema
How do I manage OCaml fiber lifecycles and ensure safe cleanup during concurrent network I/O?

You can manage OCaml fiber lifecycles using structured concurrency with Switch.run, which orchestrates fibers and ensures deterministic cleanup and safe cancellation for concurrent network I/O operations.

What is the best way to test concurrent OCaml applications deterministically?

The best way to test concurrent OCaml applications deterministically is using Eio_mock, which provides testing and mocking support for simulating file, network, and time operations without real side effects.

Why does OCaml structured concurrency require explicit capability passing for resources?

OCaml structured concurrency requires explicit capability passing for resources like net, clock, and fs to enforce safe resource handling, preventing unmanaged access and ensuring scalable asynchronous code.

Can I use Eio to build streaming pipelines and HTTP clients in OCaml?

Yes, you can build streaming pipelines and HTTP clients in OCaml using Eio integration patterns with cohttp-eio and bytesrw for robust data streaming and network operations.

How do I handle error propagation and cancellation across multiple OCaml fibers?

You handle error propagation and cancellation across OCaml fibers using Eio primitives within Switch.run, which manages structured concurrency to safely cancel child fibers and propagate errors upstream.

Do I need switches for parallel data processing in OCaml or just simple async tasks?

You need switches for parallel data processing in OCaml because they provide structured concurrency to manage complex fiber lifecycles, whereas simple async tasks may not require explicit lifecycle boundaries.