mirror of
https://github.com/corda/corda.git
synced 2025-01-21 03:55:00 +00:00
add Continuations test
This commit is contained in:
parent
57cec2d068
commit
06fd492b1a
19
test/extra/Continuations.java
Normal file
19
test/extra/Continuations.java
Normal file
@ -0,0 +1,19 @@
|
||||
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();
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user