I'm using an ActorPublisher
as an Akka-Stream Source
. I can't figure out how to predictably name the input actor so I can send it messages from other parts of my application. I'm instantiating my source like so:
val src = Source[Task](Props(classOf[TaskListener], this), "task-listener")
I get an ActorRef
when I materialize the stream, but the path for it is dynamically generated, and it only uses my provided name as part of a code-generated flow-centric naming scheme.
Is there any way to have this front-end actor source have an explicit name or am I stuck passing the ActorRef around?
If I can't explicitly name it does this mean you can't use Akka-Stream directly with remoting?
EDIT: I can find my actor using relative pathing now, but I still need to figure out how to name my Flow
so I can understand what the full path to the actor in question will be.
EDIT: (akka version info below, scala 2.11.6)
"com.typesafe.akka" %% "akka-actor" % "2.3.9"
"com.typesafe.akka" %% "akka-stream-experimental" % "1.0-M4"
EDIT: The friendly folks over at the akka-user google group have enlightened me, and suggest that the proper way to deal with this is by passing around the ActorRef
that results from the runWith()
call itself and not using .actorSelection()
. I will update this question if I find that this state of affairs changes in the future. Thanks for reading.
Source
usingSource.actorPublisher
, then created aFlow
on which i calledflow.runWith(src)
-- but that method has been deprecated since. Hopefully you have navigated your way around the problem by now. – Rich Henry