License
Boost Software License, Version 1.0
EVE Runtime Fiber Support
This module provides lightweight fiber/coroutine primitives that integrate with the EVE event loop. Fibers enable cooperative multitasking, allowing multiple logical execution contexts to run on a single thread.
Fibers can yield execution voluntarily and be resumed later, making them ideal for async I/O operations where blocking would waste resources.
Fiber execution state.
A lightweight fiber that integrates with the EVE event loop.
Fibers provide cooperative multitasking by allowing code to yield execution at specific points and be resumed later. This is more efficient than threads for I/O-bound workloads as there's no kernel-level context switching overhead.
Example:
auto fiber = Fiber({
writeln("Step 1");
Fiber.yield();
writeln("Step 2");
});
fiber.call(); // Prints "Step 1"
fiber.call(); // Prints "Step 2"bool isTerminated() const pure nothrow @nogc @safeCheck if the fiber has finished execution (either completed or failed).