abstract class Coroutine extends Runnable with Error
The Coroutine
class supports (one-at-a-time) quasi-concurrent programming.
A coroutine runs/acts until it yields control from 'this' to 'that' coroutine.
When resumed, a coroutines continues its execution where it left off.
- Alphabetic
- By Inheritance
- Coroutine
- Error
- Runnable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Coroutine(label: String = "cor")
Abstract Value Members
-
abstract
def
act(): Unit
Actor model features the 'act' method, even though threads are used.
Actor model features the 'act' method, even though threads are used. This abstract method must be implemented in application models.
Concrete Value Members
-
def
counts: (Int, Int, Int)
Return the Coroutine counts.
-
final
def
flaw(method: String, message: String): Unit
- Definition Classes
- Error
-
def
interrupt(): Unit
Interrupt this waiting coroutine.
-
def
run(): Unit
Thread's 'run' method delegates to the 'act' method.
Thread's 'run' method delegates to the 'act' method. Upon interruption the 'act' method is run again from the beginning.
- Definition Classes
- Coroutine → Runnable
-
def
start(): Future[_]
Start this coroutine, i.e., invoke its 'run' -> 'act' method.
Start this coroutine, i.e., invoke its 'run' -> 'act' method. This function returns a future.
-
def
yyield(that: Coroutine, quit: Boolean = false): Unit
Yield control from 'this' to 'that' coroutine.
Yield control from 'this' to 'that' coroutine.
- that
the other coroutine to yield control to
- quit
whether 'this' coroutine is to terminate (true) or wait to be resumed (false)