Compile-time wrapper for akka.actor.ActorRef to allow for same degree of
type-safety on actors without requiring too much changes to the underlying
system.
Compile-time wrapper for akka.actor.ActorRef to allow for same degree of
type-safety on actors without requiring too much changes to the underlying
system.
Example:
import akka.actor._
import de.knutwalker.akka.typed._
caseclass Ping(replyTo: ActorRef[Pong])
caseclass Pong(replyTo: ActorRef[Ping])
implicitval system = ActorSystem()
val ping: ActorRef[Ping] = ActorOf(PropsOf[Ping](new Actor {
def receive: Receive = {
case Ping(replyTo) ⇒ replyTo ! Pong(self.typed)
}
}))
val pong: ActorRef[Pong] = ActorOf(PropsOf[Pong](new Actor {
def receive: Receive = {
case Pong(replyTo) ⇒ replyTo ! Ping(self.typed)
}
}))
ping ! Ping(pong)
system.shutdown()
Compile-time wrapper for akka.actor.ActorRef to allow for same degree of type-safety on actors without requiring too much changes to the underlying system.
Example: