Merge paradox/scala/futures.md and java/futures.md (#23397)

This commit is contained in:
Richard Imaoka 2017-07-26 04:09:45 +09:00 committed by Arnout Engelen
parent e5249c69b6
commit e0692b5e93
4 changed files with 326 additions and 354 deletions

View file

@ -0,0 +1,17 @@
package jdocs.future;
//#context-dispatcher
import akka.actor.AbstractActor;
import akka.dispatch.Futures;
public class ActorWithFuture extends AbstractActor {
ActorWithFuture(){
Futures.future(() -> "hello", getContext().dispatcher());
}
@Override
public Receive createReceive() {
return AbstractActor.emptyBehavior();
}
}
// #context-dispatcher