Last active
December 25, 2015 01:09
-
-
Save ryantanner/6892830 to your computer and use it in GitHub Desktop.
Akka stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyCounter extends Actor { | |
| var count = 0 | |
| def receive = { | |
| case Add => count + 1 | |
| case GetCount = sender tell count | |
| } | |
| } | |
| val counter = system.actorOf(Props[MyCounter]) | |
| counter tell Add | |
| counter tell Add | |
| counter tell Add | |
| (counter ask GetCount) onSuccess { count => println(count) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment