diff --git a/akka-actor/src/main/scala/akka/actor/Actor.scala b/akka-actor/src/main/scala/akka/actor/Actor.scala index 10af5aa7a0..051d59b261 100644 --- a/akka-actor/src/main/scala/akka/actor/Actor.scala +++ b/akka-actor/src/main/scala/akka/actor/Actor.scala @@ -5,10 +5,11 @@ package akka.actor import akka.AkkaException +import akka.event.LoggingAdapter + import scala.annotation.tailrec import scala.beans.BeanProperty import scala.util.control.NoStackTrace -import akka.event.LoggingAdapter /** * INTERNAL API @@ -340,6 +341,15 @@ object Actor { def apply(x: Any) = throw new UnsupportedOperationException("Empty behavior apply()") } + /** + * ignoringBehavior is a Receive-expression that consumes and ignores all messages. + */ + @SerialVersionUID(1L) + object ignoringBehavior extends Receive { + def isDefinedAt(x: Any): Boolean = true + def apply(x: Any): Unit = () + } + /** * Default placeholder (null) used for "!" to indicate that there is no sender of the message, * that will be translated to the receiving system's deadLetters. @@ -401,8 +411,6 @@ object Actor { */ trait Actor { - import Actor._ - // to make type Receive known in subclasses without import type Receive = Actor.Receive