59 lines
2.3 KiB
Text
59 lines
2.3 KiB
Text
---------------------------------------------------------
|
||
== Akka Remote Sample Application ==
|
||
|
||
This sample has two different samples:
|
||
- Server Managed Remote Actors Sample
|
||
- Client Managed Remote Actors Sample
|
||
|
||
---------------------------------------------------------
|
||
= Server Managed Remote Actors Sample =
|
||
|
||
To run the sample:
|
||
|
||
1. Fire up two shells. For each of them:
|
||
- Step down into to the root of the Akka distribution.
|
||
- Set 'export AKKA_HOME=<root of distribution>.
|
||
- Run 'sbt'
|
||
- Run 'update' followed by 'compile' if you have not done that before.
|
||
- Run 'project akka-sample-remote'
|
||
- Run 'console' to start up a REPL (interpreter).
|
||
2. In the first REPL you get execute:
|
||
- scala> import sample.remote._
|
||
- scala> ServerManagedRemoteActorServer.run
|
||
This starts up the RemoteNode and registers the remote actor
|
||
3. In the second REPL you get execute:
|
||
- scala> import sample.remote._
|
||
- scala> ServerManagedRemoteActorClient.run
|
||
4. See the actor conversation.
|
||
5. Run it again to see full speed after first initialization.
|
||
|
||
Now you could test client reconnect by killing the console running the ServerManagedRemoteActorClient and start it up again. See the client reconnect take place in the REPL shell.
|
||
|
||
That’s it. Have fun.
|
||
|
||
---------------------------------------------------------
|
||
= Client Managed Remote Actors Sample =
|
||
|
||
To run the sample:
|
||
|
||
1. Fire up two shells. For each of them:
|
||
- Step down into to the root of the Akka distribution.
|
||
- Set 'export AKKA_HOME=<root of distribution>.
|
||
- Run 'sbt'
|
||
- Run 'update' followed by 'compile' if you have not done that before.
|
||
- Run 'project akka-sample-remote'
|
||
- Run 'console' to start up a REPL (interpreter).
|
||
2. In the first REPL you get execute:
|
||
- scala> import sample.remote._
|
||
- scala> ClientManagedRemoteActorServer.run
|
||
This starts up the RemoteNode and registers the remote actor
|
||
3. In the second REPL you get execute:
|
||
- scala> import sample.remote._
|
||
- scala> ClientManagedRemoteActorClient.run
|
||
4. See the actor conversation.
|
||
5. Run it again to see full speed after first initialization.
|
||
|
||
Now you could test client reconnect by killing the console running the ClientManagedRemoteActorClient and start it up again. See the client reconnect take place in the REPL shell.
|
||
|
||
That’s it. Have fun.
|
||
|