- Loading...
...
Symmetric coroutines are implemented via the Coroutine class. This is used by either subclassing Coroutine and overriding the run method or passing a target Runnable to the Coroutine constructor.
| Code Block | ||||||
|---|---|---|---|---|---|---|
| ||||||
public class Coroutine {
public Coroutine();
public Coroutine(Runnable target);
public Coroutine(long stacksize);
public Coroutine(Runnable target, long stacksize);
public static void yield();
public static void yieldTo(Coroutine target);
protected void run();
}
|
...
| Code Block | ||||||
|---|---|---|---|---|---|---|
| ||||||
public abstract class AsymCoroutine<InT, OutT> implements Iterable<OutT>
{
public AsymCoroutine();
public AsymCoroutine(long stacksize);
public InT ret(OutT value);
public InT ret();
public OutT call(InT input);
public OutT call();
protected abstract OutT run(InT value);
@Override
public Iterator<OutT> iterator();
}
|
*CoroutineLocal*s CoroutineLocals work like ThreadLocals with the exception that they are scoped to Coroutines.