Class AbstractActor.Receive

java.lang.Object
org.apache.pekko.actor.AbstractActor.Receive
Enclosing class:
AbstractActor

public static final class AbstractActor.Receive extends Object
Defines which messages the Actor can handle, along with the implementation of how the messages should be processed. You can build such behavior with the pekko.japi.pf.ReceiveBuilder but it can be implemented in other ways than using the ReceiveBuilder since it in the end is just a wrapper around a Scala PartialFunction. In Java, you can implement PartialFunction by extending AbstractPartialFunction.
  • Constructor Details

    • Receive

      public Receive(scala.PartialFunction<Object,scala.runtime.BoxedUnit> onMessage)
  • Method Details

    • onMessage

      public scala.PartialFunction<Object,scala.runtime.BoxedUnit> onMessage()
    • orElse

      Composes this Receive with a fallback which gets applied where this partial function is not defined.