FiberScheduler.spawnFiber

TaskHandle spawnFiber(Fiber fiber, string name = null) @trusted

Register a pre-created Fiber as a new task.

Unlike spawn(), which creates a Fiber internally, this method accepts an externally created Fiber and adds it to the scheduler. Used by FiberPool to reuse fiber stacks across multiple work items.

Parameters

fiberThe fiber to register. Must not be null or terminated.
nameOptional name for the task.

Returns

A TaskHandle for the registered fiber.