2018-03-13 23:45:55 +09:00
|
|
|
/*
|
2019-01-02 18:55:26 +08:00
|
|
|
* Copyright (C) 2018-2019 Lightbend Inc. <https://www.lightbend.com>
|
2018-03-13 23:45:55 +09:00
|
|
|
*/
|
|
|
|
|
|
2017-07-26 04:09:45 +09:00
|
|
|
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
|