Skip to content

Instantly share code, notes, and snippets.

@lamdor
Created March 5, 2012 14:28
Show Gist options
  • Select an option

  • Save lamdor/1978527 to your computer and use it in GitHub Desktop.

Select an option

Save lamdor/1978527 to your computer and use it in GitHub Desktop.
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