- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
private static class MyStatefulActor extends DefaultActor {
protected void act() {
loop(new Runnable() {
public void run() {
react(new MessagingRunnable<String>(this) {
protected void doRun(final String msg) {
System.out.println("Stage #0: " + msg);
react(new MessagingRunnable<Double>() {
protected void doRun(final Double msg) {
System.out.println(" Stage #1: " + msg);
react(new MessagingRunnable<List<Integer>>() {
protected void doRun(final List<Integer> msg) {
System.out.println(" Stage #2: " + msg + "\n");
}
});
}
});
}
});
}
});
}
}
}
На java 8 это поди получше будет смотреться...
при беглом гуглении нашлось вот это