mirror of
https://github.com/corda/corda.git
synced 2025-06-23 01:19:00 +00:00
add Continuations test
This commit is contained in:
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();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user