pekko/docs/src/test/java/jdocs/future/ActorWithFuture.java

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
472 B
Java
Raw Normal View History

/*
2022-02-04 12:36:44 +01:00
* Copyright (C) 2018-2022 Lightbend Inc. <https://www.lightbend.com>
*/
package jdocs.future;
// #context-dispatcher
import org.apache.pekko.actor.AbstractActor;
import org.apache.pekko.dispatch.Futures;
public class ActorWithFuture extends AbstractActor {
ActorWithFuture() {
Futures.future(() -> "hello", getContext().dispatcher());
}
@Override
public Receive createReceive() {
return AbstractActor.emptyBehavior();
}
}
// #context-dispatcher