Skip to content

Instantly share code, notes, and snippets.

@sc6l6d3v
Created October 19, 2016 21:45
Show Gist options
  • Save sc6l6d3v/6abe5c561c01a6c2edcb14012a17f65b to your computer and use it in GitHub Desktop.
Save sc6l6d3v/6abe5c561c01a6c2edcb14012a17f65b to your computer and use it in GitHub Desktop.
// this excerpt fails to locate actor using similar code for actorSelection()
class ReaderActorsSpec extends AbsBaseSpec with AppRuntime with AppConfig {
import scala.concurrent.ExecutionContext.Implicits.global
def findRef(path: String): Option[ActorRef] =
try {
Some(Await.result(rtSystem.actorSelection(s"/user/$path").resolveOne(1.second), 10.second))
} catch {
case ex: Throwable => None
}
val ctx = createContext(config)
val coordRef = rtSystem.actorOf(Props(classOf[CoordinationActor], ctx, config), "coordinator")
val coordCheck = findRef("coordinator")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment