newFiber

fun newFiber(resultType: A_Type, runtime: AvailRuntime, textInterface: TextInterface, priority: Int, setup: A_Fiber.() -> Unit = { }, nameSupplier: () -> A_String): A_Fiber

Construct an unstarted fiber with the specified result type and initial priority.

Return

The new fiber.

Parameters

resultType

The expected result type.

runtime

The AvailRuntime that will eventually be given the fiber to run.

textInterface

The TextInterface for providing console I/O in this fiber.

priority

The initial priority.

setup

A function to run against the fiber before scheduling it. The function execution happens before any debugger hooks run.

nameSupplier

A supplier that produces an Avail string to name this fiber on demand. Please don't run Avail code to do so, since if this is evaluated during fiber execution it will cause the current Thread's execution to block, potentially starving the execution pool.