pekko/akka-samples/akka-sample-chat
2011-05-16 12:32:00 +02:00
..
src/main/scala Merged wip-2.0 branch with latest master 2011-05-16 12:32:00 +02:00
README Added parens to start 2011-04-12 09:56:17 +02:00

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Akka Chat Client/Server Sample Application

How 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 console' to start up a REPL (interpreter).
2. In the first REPL you get execute:
  - scala> import sample.chat._
  - scala> import akka.actor.Actor._
  - scala> val chatService = actorOf[ChatService].start()
3. In the second REPL you get execute:
    - scala> import sample.chat._
    - scala> ClientRunner.run
4. See the chat simulation run.
5. Run it again to see full speed after first initialization.
6. In the client REPL, or in a new REPL, you can also create your own client
 - scala> import sample.chat._
 - scala> val myClient = new ChatClient("<your name>")
 - scala> myClient.login
 - scala> myClient.post("Can I join?")
 - scala> println("CHAT LOG:\n\t" + myClient.chatLog.log.mkString("\n\t"))

Thats it. Have fun.