|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Controler<E,A>
Interface used to control coroutine's execution. Its purpose is to further
decouple coroutine's caller (client of CoIterator
) from the
coroutine's logic. Caller may use CoIterator.with(Controler)
method
and consume results without burden of sending appropriate values to
underlying coroutine - this task being imposed on this Controler
Method Summary | |
---|---|
void |
closed()
Called when coroutine has been closed |
A |
init()
Generate value sent to coroutine on the first yield |
void |
noNextElement()
Called when coroutine has been closed because it was unable to generate more results |
A |
respondTo(E produced)
Generates the next value sent to coroutine after some yield has generated produced |
Method Detail |
---|
void closed()
A init()
yield
void noNextElement()
A respondTo(E produced) throws java.lang.IllegalStateException
yield
has generated produced
produced
- last yielded value
java.lang.IllegalStateException
- Controler
may throw this exception to forcibly
close underlying coroutine
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |