Created
March 5, 2012 14:28
-
-
Save lamdor/1978527 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
| package eg | |
| import com.typesafe.config.ConfigFactory | |
| import akka.actor.{ ActorRef, Props, Deploy, Actor, ActorSystem, Address, AddressFromURIString } | |
| import akka.remote.RemoteScope | |
| class HelloActor extends Actor { | |
| def receive = { | |
| case _ => println("hello") | |
| } | |
| } | |
| object Test { | |
| def main(args: Array[String]) { | |
| val system = ActorSystem("testing") | |
| val address = Address("akka", "testing", "127.0.0.1", 2553) | |
| // pragmatic way | |
| val actor = system.actorOf(Props[HelloActor].withDeploy(Deploy(scope = RemoteScope(address)))) | |
| // why doesn't the actor path just include it?? if it was deployed with a remote scpe? | |
| println("path is " + actor.path.toStringWithAddress(address)) | |
| system.shutdown | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment