32 lines
1.3 KiB
Text
32 lines
1.3 KiB
Text
Akka Chat Client/Server Sample Application
|
||
|
||
First we need to download, build and start up Redis:
|
||
|
||
1. Download Redis from http://code.google.com/p/redis/downloads/list.
|
||
2. Step into the distribution.
|
||
3. Build: ‘make install’.
|
||
4. Run: ‘./redis-server’.
|
||
For details on how to set up Redis server have a look at http://code.google.com/p/redis/wiki/QuickStart.
|
||
|
||
Then to run the sample:
|
||
|
||
1. Install the Redis network storage. Download it from [http://code.google.com/p/redis/].
|
||
2. Open up a shell and start up an instance of Redis.
|
||
3. 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 console' to start up a REPL (interpreter).
|
||
4. In the first REPL you get execute:
|
||
- scala> import sample.chat._
|
||
- scala> import se.scalablesolutions.akka.actor.Actor._
|
||
- scala> val chatService = actorOf[ChatService].start
|
||
5. In the second REPL you get execute:
|
||
- scala> import sample.chat._
|
||
- scala> Runner.run
|
||
6. See the chat simulation run.
|
||
7. Run it again to see full speed after first initialization.
|
||
|
||
Now you could test client reconnect by killing the console running the ChatService and start it up again. See the client reconnect take place in the REPL shell.
|
||
|
||
That’s it. Have fun.
|
||
|