corda/test/extra/Continuations.java

20 lines
524 B
Java
Raw Normal View History

2009-05-16 08:01:07 +00:00
package extra;
import static avian.Continuations.callWithCurrentContinuation;
import avian.CallbackReceiver;
import avian.Callback;
public class Continuations {
public static void main(String[] args) throws Exception {
System.out.println
("result: " +
callWithCurrentContinuation(new CallbackReceiver<Integer>() {
public Integer receive(Callback<Integer> continuation) {
continuation.handleResult(42);
throw new RuntimeException();
}
}));
}
}