Defines the actors behavior.
Defines the actors behavior. Unlike akka.actor.Actor#receive, this one is typed in its first parameter.
Wraps a total receiver function and returns it as a TypedReceive.
Wraps a total receiver function and returns it as a TypedReceive. Use this to get exhaustiveness checking for your receive block.
// error: match may not be exhaustive. It would fail on the following inputs: None class ExampleActor extends TypedActor.Of[Option[String]] { def typedReceive: TypedReceive = Total { case Some("foo") ⇒ } }
Wraps an untyped receiver and returns it as a TypedReceive.
Wraps an untyped receiver and returns it as a TypedReceive. Use this to match for messages that are outside of your protocol, e.g. akka.actor.Terminated.
class ExampleActor extends TypedActor.Of[ExampleMessage] { def typedReceive: TypedReceive = Untyped { case Terminated(ref) => println(s"$$ref terminated") } }
TypedActor
s delegate to typedReceive.
TypedActor
s delegate to typedReceive.
Typed variant of context.become
.
Typed variant of context.become
.
Typed variant of self.
Typed variant of self.
Wraps a typed receive and returns it as an untyped receive.
Wraps a typed receive and returns it as an untyped receive. Use this only if you have to mix with other traits that override receive, where you need to repeat the implementation of this typed actors default receive method.
Abstract class to extend from in order to get a TypedActor. If you want to have the message type provided as a type parameter, you have to add a context bound for scala.reflect.ClassTag.
the message type this actor is receiving