FiberPool.spawn

bool spawn(void delegate() work) @trusted

Spawn a work item on a fiber from the pool.

If a free fiber is available, reuses it by setting its work slot and un-parking it. Otherwise allocates a new fiber (unless the pool has reached maxSize).

Parameters

workThe delegate to execute inside a pooled fiber.

Returns

true if the work was dispatched, false if the pool is

exhausted and at maximum capacity.