package io
- Alphabetic
- Public
- All
Type Members
-
abstract
class
AbstractPipePair
[CmdAbove, CmdBelow, EvtAbove, EvtBelow] extends AnyRef
Java API: A pair of pipes, one for commands and one for events.
Java API: A pair of pipes, one for commands and one for events. Commands travel from top to bottom, events from bottom to top.
-
abstract
class
AbstractPipelineContext
extends PipelineContext
This base trait of each pipeline’s context provides optimized facilities for generating single commands or events (i.e.
This base trait of each pipeline’s context provides optimized facilities for generating single commands or events (i.e. the fast common case of 1:1 message transformations).
IMPORTANT NOTICE:
A PipelineContext MUST NOT be shared between multiple pipelines, it contains mutable state without synchronization. You have been warned!
-
abstract
class
AbstractSymmetricPipePair
[Above, Below] extends AbstractPipePair[Above, Below, Above, Below]
A convenience type for expressing a AbstractPipePair which has the same types for commands and events.
-
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).
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 themaxCapacity
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. ThelowWatermark
must be less than or equal to thehighWatermark
, 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). -
class
DelimiterFraming
extends SymmetricPipelineStage[PipelineContext, ByteString, ByteString]
Pipeline stage for delimiter byte based framing and de-framing.
Pipeline stage for delimiter byte based framing and de-framing. Useful for string oriented protocol using '\n' or 0 as delimiter values.
-
trait
HasActorContext
extends PipelineContext
This trait expresses that the pipeline’s context needs to live within an actor and provide its ActorContext.
-
trait
HasLogging
extends PipelineContext
This trait expresses that the pipeline’s context needs to provide a logging facility.
-
class
LengthFieldFrame
extends SymmetricPipelineStage[PipelineContext, ByteString, ByteString]
Pipeline stage for length-field encoded framing.
Pipeline stage for length-field encoded framing. It will prepend a four-byte length header to the message; the header contains the length of the resulting frame including header in big-endian representation.
The
maxSize
argument is used to protect the communication channel sanity: larger frames will not be sent (silently dropped) or received (in which case stream decoding would be broken, hence throwing an IllegalArgumentException). -
trait
PipePair
[CmdAbove, CmdBelow, EvtAbove, EvtBelow] extends AnyRef
Scala API: A pair of pipes, one for commands and one for events, plus a management port.
Scala API: A pair of pipes, one for commands and one for events, plus a management port. Commands travel from top to bottom, events from bottom to top. All messages which need to be handled “in-order” (e.g. top-down or bottom-up) need to be either events or commands; management messages are processed in no particular order.
Java base classes are provided in the form of AbstractPipePair and AbstractSymmetricPipePair since the Scala function types can be awkward to handle in Java.
-
trait
PipelineContext
extends AnyRef
This base trait of each pipeline’s context provides optimized facilities for generating single commands or events (i.e.
This base trait of each pipeline’s context provides optimized facilities for generating single commands or events (i.e. the fast common case of 1:1 message transformations).
IMPORTANT NOTICE:
A PipelineContext MUST NOT be shared between multiple pipelines, it contains mutable state without synchronization. You have been warned!
- See also
AbstractPipelineContext see AbstractPipelineContext for a default implementation (Java)
-
trait
PipelineInjector
[Cmd, Evt] extends AnyRef
A handle for injecting commands and events into a pipeline.
A handle for injecting commands and events into a pipeline. Commands travel down (or to the right) through the stages, events travel in the opposite direction.
- case class PipelinePorts [CmdAbove, CmdBelow, EvtAbove, EvtBelow](commands: (CmdAbove) ⇒ (Iterable[EvtAbove], Iterable[CmdBelow]), events: (EvtBelow) ⇒ (Iterable[EvtAbove], Iterable[CmdBelow]), management: PartialFunction[AnyRef, (Iterable[EvtAbove], Iterable[CmdBelow])]) extends Product with Serializable
-
abstract
class
PipelineSink
[Cmd, Evt] extends AnyRef
A sink which can be attached by PipelineFactory#buildWithSink to a pipeline when it is being built.
A sink which can be attached by PipelineFactory#buildWithSink to a pipeline when it is being built. The methods are called when commands, events or their failures occur during evaluation of the pipeline (i.e. when injection is triggered using the associated PipelineInjector).
-
abstract
class
PipelineStage
[Context <: PipelineContext, CmdAbove, CmdBelow, EvtAbove, EvtBelow] extends AnyRef
A pipeline stage which can be combined with other stages to build a protocol stack.
-
class
StringByteStringAdapter
extends PipelineStage[PipelineContext, String, ByteString, String, ByteString]
Simple convenience pipeline stage for turning Strings into ByteStrings and vice versa.
-
trait
SymmetricPipePair
[Above, Below] extends PipePair[Above, Below, Above, Below]
A convenience type for expressing a PipePair which has the same types for commands and events.
-
abstract
class
SymmetricPipelineStage
[Context <: PipelineContext, Above, Below] extends PipelineStage[Context, Above, Below, Above, Below]
A PipelineStage which is symmetric in command and event types, i.e.
A PipelineStage which is symmetric in command and event types, i.e. it only has one command and event type above and one below.
-
class
TcpPipelineHandler
[Ctx <: PipelineContext, Cmd, Evt] extends Actor with RequiresMessageQueue[UnboundedMessageQueueSemantics]
This actor wraps a pipeline and forwards commands and events between that one and a Tcp connection actor.
This actor wraps a pipeline and forwards commands and events between that one and a Tcp connection actor. In order to inject commands into the pipeline send an TcpPipelineHandler.Init.Command message to this actor; events will be sent to the designated handler wrapped in TcpPipelineHandler.Init.Event messages.
When the designated handler terminates the TCP connection is aborted. When the connection actor terminates this actor terminates as well; the designated handler may want to watch this actor’s lifecycle.
IMPORTANT:
Proper function of this actor (and of other pipeline stages like TcpReadWriteAdapter depends on the fact that stages handling TCP commands and events pass unknown subtypes through unaltered. There are more commands and events than are declared within the Tcp object and you can even define your own.
-
class
TcpReadWriteAdapter
extends PipelineStage[PipelineContext, ByteString, Command, ByteString, Event]
Adapts a ByteString oriented pipeline stage to a stage that communicates via Tcp Commands and Events.
Adapts a ByteString oriented pipeline stage to a stage that communicates via Tcp Commands and Events. Every ByteString passed down to this stage will be converted to Tcp.Write commands, while incoming Tcp.Receive events will be unwrapped and their contents passed up as raw ByteStrings. This adapter should be used together with TcpPipelineHandler.
While this adapter communicates to the stage above it via raw ByteStrings, it is possible to inject Tcp Command by sending them to the management port, and the adapter will simply pass them down to the stage below. Incoming Tcp Events that are not Receive events will be passed downwards wrapped in a TcpPipelineHandler.TcpEvent; the TcpPipelineHandler will send these notifications to the registered event handler actor.
-
class
TickGenerator
[Cmd <: AnyRef, Evt <: AnyRef] extends PipelineStage[HasActorContext, Cmd, Cmd, Evt, Evt]
This pipeline stage does not alter the events or commands
Value Members
- object BackpressureBuffer
-
object
PipePairFactory
This class contains static factory methods which produce PipePair instances; those are needed within the implementation of PipelineStage#apply.
-
object
PipelineFactory
This class contains static factory methods which turn a pipeline context and a PipelineStage into readily usable pipelines.
- object PipelineStage
- object TcpPipelineHandler
- object TickGenerator