akka.stream.actor

ActorConsumer

trait ActorConsumer extends Actor

Extend/mixin this trait in your akka.actor.Actor to make it a stream consumer with full control of stream back pressure. It will receive ActorConsumer.OnNext, ActorConsumer.OnComplete and ActorConsumer.OnError messages from the stream. It can also receive other, non-stream messages, in the same way as any actor.

Attach the actor as a org.reactivestreams.api.Consumer to the stream with ActorConsumer#apply.

Subclass must define the RequestStrategy to control stream back pressure. After each incoming message the ActorConsumer will automatically invoke the RequestStrategy#requestDemand and propagate the returned demand to the stream. The provided ActorConsumer.WatermarkRequestStrategy is a good strategy if the actor performs work itself. The provided ActorConsumer.MaxInFlightRequestStrategy is useful if messages are queued internally or delegated to other actors. You can also implement a custom RequestStrategy or call #request manually together with ActorConsumer.ZeroRequestStrategy or some other strategy. In that case you must also call #request when the actor is started or when it is ready, otherwise it will not receive any elements.

Source
ActorConsumer.scala
Linear Supertypes
Actor, AnyRef, Any
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ActorConsumer
  2. Actor
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type Receive = PartialFunction[Any, Unit]

    Definition Classes
    Actor

Abstract Value Members

  1. abstract def receive: actor.Actor.Receive

    Definition Classes
    Actor
  2. abstract def requestStrategy: RequestStrategy

    Attributes
    protected

Concrete Value Members

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

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

    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from ActorConsumer to any2stringadd[ActorConsumer] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (ActorConsumer, B)

    Implicit information
    This member is added by an implicit conversion from ActorConsumer to ArrowAssoc[ActorConsumer] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  6. def aroundPostRestart(reason: Throwable): Unit

    Attributes
    protected[akka]
    Definition Classes
    ActorConsumer → Actor
  7. def aroundPostStop(): Unit

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

    Attributes
    protected[akka]
    Definition Classes
    ActorConsumer → Actor
  9. def aroundPreStart(): Unit

    Attributes
    protected[akka]
    Definition Classes
    ActorConsumer → Actor
  10. def aroundReceive(receive: Receive, msg: Any): Unit

    Attributes
    protected[akka]
    Definition Classes
    ActorConsumer → Actor
  11. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  12. def cancel(): Unit

    Cancel upstream subscription.

    Cancel upstream subscription. No more elements will be delivered after cancel.

    Attributes
    protected
  13. def clone(): AnyRef

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

    Definition Classes
    Actor
  15. def ensuring(cond: (ActorConsumer) ⇒ Boolean, msg: ⇒ Any): ActorConsumer

    Implicit information
    This member is added by an implicit conversion from ActorConsumer to Ensuring[ActorConsumer] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: (ActorConsumer) ⇒ Boolean): ActorConsumer

    Implicit information
    This member is added by an implicit conversion from ActorConsumer to Ensuring[ActorConsumer] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: Boolean, msg: ⇒ Any): ActorConsumer

    Implicit information
    This member is added by an implicit conversion from ActorConsumer to Ensuring[ActorConsumer] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. def ensuring(cond: Boolean): ActorConsumer

    Implicit information
    This member is added by an implicit conversion from ActorConsumer to Ensuring[ActorConsumer] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from ActorConsumer to StringFormat[ActorConsumer] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  23. final def getClass(): Class[_]

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

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

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

    Definition Classes
    AnyRef
  27. final def notify(): Unit

    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

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

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

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

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

    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  33. def request(elements: Int): Unit

    Request a number of elements from upstream.

    Request a number of elements from upstream.

    Attributes
    protected
  34. implicit final val self: ActorRef

    Definition Classes
    Actor
  35. final def sender(): ActorRef

    Definition Classes
    Actor
  36. def supervisorStrategy: SupervisorStrategy

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

    Definition Classes
    AnyRef
  38. def toString(): String

    Definition Classes
    AnyRef → Any
  39. def unhandled(message: Any): Unit

    Definition Classes
    Actor
  40. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. def [B](y: B): (ActorConsumer, B)

    Implicit information
    This member is added by an implicit conversion from ActorConsumer to ArrowAssoc[ActorConsumer] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from Actor

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from ActorConsumer to any2stringadd[ActorConsumer]

Inherited by implicit conversion StringFormat from ActorConsumer to StringFormat[ActorConsumer]

Inherited by implicit conversion Ensuring from ActorConsumer to Ensuring[ActorConsumer]

Inherited by implicit conversion ArrowAssoc from ActorConsumer to ArrowAssoc[ActorConsumer]

Ungrouped