All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----javaCoroutine.Coroutine
Coroutines are created as instances of Coroutine-derived classes that override the abstract method body. The body method is used to specify their actions.
A coroutine may temporarily suspend its execution and another coroutine may take over. A suspended coroutine may later be resumed at the point where it was suspended.
Resumption can be performed by one of two operations, resume(c) and call(c), where c is a Coroutine-object.
Both operations resumes c and supends the currently executing coroutine.
The call operation furthermore establishes the current coroutine as c's caller. Coroutine c is said to be attached to its caller.
A coroutine can relinquish control to its caller by means of the operation detach(). This causes the caller to resume its execution from the point where it last left off.
public Coroutine()
public static final void resume(javaCoroutine.Coroutine next)
The coroutine is resumed from the point where if last left off.
public static final void call(javaCoroutine.Coroutine next)
The coroutine is attached to the current coroutine and resumed from the point where if last left off.
public static final void detach()
The coroutine is suspended and its caller is resumed.
If the coroutine has no caller, the "main coroutine" is resumed. The main coroutine designates the first coroutine resumed (or called) in a system of coroutines.
public static final javaCoroutine.Coroutine currentCoroutine()
public static final javaCoroutine.Coroutine mainCoroutine()
All Packages Class Hierarchy This Package Previous Next Index