Task.assignTo

Assigns the task to a fiber. In most cases you need to use Scheduler.schedule instead.

In simple applications there tends to be 1-to-1 relation between task and fiber it executes in. However in highly concurrent server apps it may be necessary to maintain a separate task queue because of memory consumption reasons (fiber has to allocate a stack for itself which doesn't allow having too many of them). Such functionality is provided by ocean.task.Scheduler.

class Task
void
assignTo
(,
scope void delegate
()
entry_point = null
)

Parameters

fiber WorkerFiber

the fiber to assign the task to

entry_point void delegate
()

optional custom entry point to replace this.entryPoint

Meta