Class

de.knutwalker.akka.typed.TypedActor

Of

Related Doc: package TypedActor

Permalink

abstract class Of[A] extends TypedActor

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.

class ExampleActor extends TypeActor.Of[ExampleProtocol] {
  // ...
}
A

the message type this actor is receiving

Linear Supertypes
TypedActor, Actor, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Of
  2. TypedActor
  3. Actor
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Of()

    Permalink

Type Members

  1. final type Message = A

    Permalink
    Definition Classes
    OfTypedActor
  2. type Receive = PartialFunction[Any, Unit]

    Permalink
    Definition Classes
    Actor
  3. final type TypedReceive = PartialFunction[Message, Unit]

    Permalink
    Definition Classes
    TypedActor

Abstract Value Members

  1. abstract def typedReceive: TypedReceive

    Permalink

    Defines the actors behavior.

    Defines the actors behavior. Unlike akka.actor.Actor#receive, this one is typed in its first parameter.

    Definition Classes
    TypedActor

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def Total(f: (Message) ⇒ Unit)(implicit ct: ClassTag[Message]): TypedReceive

    Permalink

    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") ⇒
      }
    }
    Definition Classes
    TypedActor
  5. final def TotalUnion(implicit ev: IsUnion[Message]): MkTotalUnionReceiveEmpty[Out]

    Permalink

    Builds final receive out of sub-receives if this TypedActor is for a Union message type.

    Builds final receive out of sub-receives if this TypedActor is for a Union message type. This mirrors a Total receive, i.e. you must provide all cases.

    class ExampleActor extends TypedActor.Of[Foo | Bar | Baz] {
      def typedReceive: TypedReceive = TotalUnion
        .on[Foo]{ case Foo() => println("foo") }
        .on[Bar]{ case Bar() => println("bar") }
        .on[Bax]{ case Bax() => println("bax") }
        .apply
      }
    }
    Definition Classes
    TypedActor
  6. final def Union(implicit ev: IsUnion[Message]): MkPartialUnionReceive[Out, Empty]

    Permalink

    Builds final receive out of sub-receives if this TypedActor is for a Union message type.

    Builds final receive out of sub-receives if this TypedActor is for a Union message type. This mirrors a TypedReceive, i.e. you must not cover all cases.

    class ExampleActor extends TypedActor.Of[Foo | Bar | Baz] {
      def typedReceive: TypedReceive = Union
        .on[Foo]{ case Foo() => println("foo") }
        .on[Bar]{ case Bar() => println("bar") }
        .apply
      }
    }
    Definition Classes
    TypedActor
  7. final def Untyped(f: Receive): TypedReceive

    Permalink

    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")
      }
    }
    Definition Classes
    TypedActor
  8. def aroundPostRestart(reason: Throwable): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
  9. def aroundPostStop(): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
  10. def aroundPreRestart(reason: Throwable, message: Option[Any]): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
  11. def aroundPreStart(): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
  12. def aroundReceive(receive: akka.actor.Actor.Receive, msg: Any): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
  13. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. implicit val context: ActorContext

    Permalink
    Definition Classes
    Actor
  16. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  20. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. def postRestart(reason: Throwable): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  26. def postStop(): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  27. def preRestart(reason: Throwable, message: Option[Any]): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  28. def preStart(): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  29. def receive: Receive

    Permalink

    TypedActors delegate to typedReceive.

    TypedActors delegate to typedReceive.

    Definition Classes
    TypedActor → Actor
    See also

    akka.actor.Actor#receive

  30. implicit final val self: akka.actor.ActorRef

    Permalink
    Definition Classes
    Actor
  31. final def sender(): akka.actor.ActorRef

    Permalink
    Definition Classes
    Actor
  32. def supervisorStrategy: SupervisorStrategy

    Permalink
    Definition Classes
    Actor
  33. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  34. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  35. final def typedBecome(f: TypedReceive): Unit

    Permalink

    Typed variant of context.become.

    Typed variant of context.become.

    Definition Classes
    TypedActor
  36. final val typedSelf: ActorRef[Message]

    Permalink

    Typed variant of self.

    Typed variant of self.

    Definition Classes
    TypedActor
  37. def unhandled(message: Any): Unit

    Permalink
    Definition Classes
    Actor
  38. final def unionBecome(implicit ev: IsUnion[Message]): TypedBecomeOnAux[Out]

    Permalink

    context.become for a given subtype if this actor is of a union type.

    context.become for a given subtype if this actor is of a union type.

    Definition Classes
    TypedActor
  39. final def untypedFromTyped(f: TypedReceive): Receive

    Permalink

    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.

    Attributes
    protected
    Definition Classes
    TypedActor
  40. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from TypedActor

Inherited from Actor

Inherited from AnyRef

Inherited from Any

Ungrouped