Last active
August 26, 2016 18:49
-
-
Save wsargent/8c41967744b8bb362ca74440f383ffa6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.ActorRef; | |
import akka.actor.ActorSystem; | |
import akka.util.Timeout; | |
import scala.compat.java8.FutureConverters; | |
import scala.concurrent.Future; | |
import java.util.concurrent.CompletionStage; | |
import java.util.concurrent.TimeUnit; | |
public class JavaActorLookup { | |
public CompletionStage<ActorRef> resolveActor(ActorSystem system, String path, akka.util.Timeout timeout) { | |
Future<ActorRef> futureActorRef = system.actorSelection(path).resolveOne(timeout); | |
CompletionStage<ActorRef> completionStage = FutureConverters.toJava(futureActorRef); | |
return completionStage; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment