Hello.

I'm defining two sets of actors, in two different actor systems (to get 
around an outstanding bug with a third party project...) any who, I need to 
get a ActorRef from one actor, that's inside of a completely different 
ActorSystem.

How can I do this?

Here's some code. (Setting up actors in two different systems)

object Boot extends App with PropertiesTrait {
implicit val system = ActorSystem("http")

val listener = system.actorOf(Props[Listener], "dead-letter-listener")
system.eventStream.subscribe(listener, classOf[DeadLetter])
 val router = system.actorOf(Props[Router], "router")
        val apnsBackService = system.actorOf(Props[ApnsBackService], 
"apns-back-service")
val notificationService = system.actorOf(Props[NotificationService], 
"notification-service")
IO(Http) ! Http.Bind(router, interface = routerInterfaceConf, port = 
routerPortConf)

val streamService = system.actorOf(Props[StreamService], "stream-service")
IO(Sockets)(ActorSystem("sockets")) ! Http.Bind(streamService, interface = 
streamInterfaceConf, port = streamPortConf)
}

(Where I want to get the ActorRef the streamService actor in the "sockets" 
actorsystem, from within the notificationService actor in the "http" actor 
system

class NotificationService extends Actor with NotificationMarshaller with 
NotificationMongoDbTrait with UserMarshaller with CosmoMarshaller {
implicit val timeout: Timeout = Duration(8, SECONDS)
val apnsService = context.actorSelection("user/apns-service") // THIS WORKS!

def receive = {

etc etc....

apnsService works fine, but if i did wrote the same code, using path 
"user/stream-service" then of course it wouldn't work because context is 
looking only inside of its actor system.

Please help!

Thanks!

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to