2018-03-13 23:45:55 +09:00
|
|
|
/*
|
2022-02-04 12:36:44 +01:00
|
|
|
* Copyright (C) 2018-2022 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;
|
|
|
|
|
|
2019-01-12 04:00:53 +08:00
|
|
|
// #context-dispatcher
|
2022-11-12 10:21:24 +01:00
|
|
|
import org.apache.pekko.actor.AbstractActor;
|
|
|
|
|
import org.apache.pekko.dispatch.Futures;
|
2017-07-26 04:09:45 +09:00
|
|
|
|
|
|
|
|
public class ActorWithFuture extends AbstractActor {
|
2019-01-12 04:00:53 +08:00
|
|
|
ActorWithFuture() {
|
2017-07-26 04:09:45 +09:00
|
|
|
Futures.future(() -> "hello", getContext().dispatcher());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Receive createReceive() {
|
|
|
|
|
return AbstractActor.emptyBehavior();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// #context-dispatcher
|