akka Actor DSL Simple Actor DSL

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

To create simple actors without creating a new class, you can use:

import akka.actor.ActorDSL._
import akka.actor.ActorSystem
 
implicit val system = ActorSystem("demo")

val a = actor(new Act {
  become {
    case "hello" ⇒ sender() ! "hi"
  }
})


Got any akka Question?