From b481db395247db62cd5ff285f9c9f9a2accfd945 Mon Sep 17 00:00:00 2001 From: viktorklang Date: Wed, 21 Dec 2011 23:33:13 +0100 Subject: [PATCH] Ticket 1546: correcting remote docs. --- akka-docs/scala/remoting.rst | 40 ++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/akka-docs/scala/remoting.rst b/akka-docs/scala/remoting.rst index 0c62d26876..8201e37815 100644 --- a/akka-docs/scala/remoting.rst +++ b/akka-docs/scala/remoting.rst @@ -1,4 +1,3 @@ - .. _remoting-scala: ################# @@ -29,14 +28,16 @@ First of all you have to change the actor provider from ``LocalActorRefProvider` After that you must also add the following settings:: akka { - server { - # The hostname or ip to bind the remoting to, - # InetAddress.getLocalHost.getHostAddress is used if empty - hostname = "" + remote { + server { + # The hostname or ip to bind the remoting to, + # InetAddress.getLocalHost.getHostAddress is used if empty + hostname = "" - # The default remote server port clients should connect to. - # Default is 2552 (AKKA) - port = 2552 + # The default remote server port clients should connect to. + # Default is 2552 (AKKA) + port = 2552 + } } } @@ -46,8 +47,19 @@ reference file for more information: * `reference.conf of akka-remote `_ -Using Remote Actors -^^^^^^^^^^^^^^^^^^^ +Looking up Remote Actors +^^^^^^^^^^^^^^^^^^^^^^^^ + +``actorFor(path)`` will obtain an ``ActorRef`` to an Actor on a remote node:: + + val actor = context.actorFor("akka://app@10.0.0.1:2552/user/serviceA/retrieval") + +As you can see from the example above the following pattern is used to find an ``ActorRef`` on a remote node:: + + akka://@:/ + +Creating Actors Remotely +^^^^^^^^^^^^^^^^^^^^^^^^ The configuration below instructs the system to deploy the actor "retrieval” on the specific host "app@10.0.0.1". The "app" in this case refers to the name of the ``ActorSystem``:: @@ -67,14 +79,6 @@ actor created above you would do the following:: val actor = context.actorFor("/serviceA/retrieval") -This will obtain an ``ActorRef`` on a remote node:: - - val actor = context.actorFor("akka://app@10.0.0.1:2552/user/serviceA/retrieval") - -As you can see from the example above the following pattern is used to find an ``ActorRef`` on a remote node:: - - akka://@:/ - Serialization ^^^^^^^^^^^^^