Akka Actors and Concurrency Model

Akka is a toolkit for building concurrent, distributed, and resilient message-driven applications using actors.

Basic Actor

import akka.actor._

class Greeter extends Actor {
  def receive = {
    case "hello" => println("Hello from actor!")
  }
}

val system = ActorSystem("HelloSystem")
val greeter = system.actorOf(Props[Greeter], name = "greeter")
greeter ! "hello"

Actors communicate via messages, not shared memory.

← PrevNext →