Skip to content

Instantly share code, notes, and snippets.

@ryantanner
Last active December 25, 2015 01:09
Show Gist options
  • Select an option

  • Save ryantanner/6892830 to your computer and use it in GitHub Desktop.

Select an option

Save ryantanner/6892830 to your computer and use it in GitHub Desktop.
Akka stuff
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