akka.io

BackpressureBuffer

class BackpressureBuffer extends PipelineStage[HasLogging, Command, Command, Event, Event]

This pipeline stage implements a configurable buffer for transforming the per-write ACK/NACK-based backpressure model of a TCP connection actor into an edge-triggered back-pressure model: the upper stages will receive notification when the buffer runs full (BackpressureBuffer.HighWatermarkReached) and when it subsequently empties (BackpressureBuffer.LowWatermarkReached). The upper layers should respond by not generating more writes when the buffer is full. There is also a hard limit upon which this buffer will abort the connection.

All limits are configurable and are given in number of bytes. The highWatermark should be set such that the amount of data generated before reception of the asynchronous BackpressureBuffer.HighWatermarkReached notification does not lead to exceeding the maxCapacity hard limit; if the writes may arrive in bursts then the difference between these two should allow for at least one burst to be sent after the high watermark has been reached. The lowWatermark must be less than or equal to the highWatermark, where the difference between these two defines the hysteresis, i.e. how often these notifications are sent out (i.e. if the difference is rather large then it will take some time for the buffer to empty below the low watermark, and that room is then available for data sent in response to the BackpressureBuffer.LowWatermarkReached notification; if the difference was small then the buffer would more quickly oscillate between these two limits).

Linear Supertypes
PipelineStage[HasLogging, Command, Command, Event, Event], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. BackpressureBuffer
  2. PipelineStage
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BackpressureBuffer(lowBytes: Long, highBytes: Long, maxBytes: Long)

Type Members

  1. case class Ack(num: Int, ack: Event) extends Event with NoSerializationVerificationNeeded with Product with Serializable

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def >>[CmdBelowBelow, EvtBelowBelow, BelowContext <: HasLogging](right: PipelineStage[_ >: BelowContext, Command, CmdBelowBelow, Event, EvtBelowBelow]): PipelineStage[BelowContext, Command, CmdBelowBelow, Event, EvtBelowBelow]

    Scala API: attach the two given stages such that the command output of the first is fed into the command input of the second, and the event output of the second is fed into the event input of the first.

    Scala API: attach the two given stages such that the command output of the first is fed into the command input of the second, and the event output of the second is fed into the event input of the first. In other words: sequence the stages such that the left one is on top of the right one.

    right

    the right or lower pipeline stage

    returns

    a pipeline stage representing the sequence of the two stages

    Definition Classes
    PipelineStage
  7. def apply(ctx: HasLogging): PipePair[Command, Command, Event, Event] { ... /* 2 definitions in type refinement */ }

    Implement this method to generate this stage’s pair of command and event functions.

    Implement this method to generate this stage’s pair of command and event functions.

    INTERNAL API: do not use this method to instantiate a pipeline!

    Definition Classes
    BackpressureBufferPipelineStage
    See also

    AbstractSymmetricPipePair

    AbstractPipePair

    PipelineFactory

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean

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

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. def |[RightContext <: HasLogging](right: PipelineStage[_ >: RightContext, Command, Command, Event, Event]): PipelineStage[RightContext, Command, Command, Event, Event]

    Scala API: combine the two stages such that the command pipeline of the left stage is used and the event pipeline of the right, discarding the other two sub-pipelines.

    Scala API: combine the two stages such that the command pipeline of the left stage is used and the event pipeline of the right, discarding the other two sub-pipelines.

    right

    the event pipeline

    returns

    a pipeline stage using the left command pipeline and the right event pipeline

    Definition Classes
    PipelineStage

Inherited from PipelineStage[HasLogging, Command, Command, Event, Event]

Inherited from AnyRef

Inherited from Any

Ungrouped