Writing 'SCALA' ble & concurrent code
CHENSE meetup , Aug 24 2013
"Concurrency solves the problem of having scarce CPU resources and many tasks. So, you create threads or independent paths of execution through code in order to share time on the scarce resource"
Note : Multiple Gophers => Multicore CPU
class Greeter extends Actor {
var greeting = ""
def receive = {
case WhoToGreet(who) => {
greeting = s"hello, $who"
println(greeting)
}
}
}
object HelloAkkaScala extends App {
// Create the 'helloakka' actor system
val system = ActorSystem("helloakka")
// Create the 'greeter' actor
val greeter = system.actorOf(Props[Greeter], "greeter")
greeter.!(WhoToGreet("first message"))
system.shutdown()
}
Source :- https://github.com/prassee/hello-akka
Chense G+ page https://plus.google.com/communities/100102886005161141056