Java API: A pair of pipes, one for commands and one for events.
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!
A convenience type for expressing a AbstractPipePair
which has the same types
for commands and events.
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 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).
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.
This trait expresses that the pipeline’s context needs to live within an actor and provide its ActorContext.
This trait expresses that the pipeline’s context needs to provide a logging facility.
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).
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.
AbstractSymmetricPipePair
AbstractPipePair
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!
AbstractPipelineContext see AbstractPipelineContext for a default implementation (Java)
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.
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).
A pipeline stage which can be combined with other stages to build a protocol stack.
Simple convenience pipeline stage for turning Strings into ByteStrings and vice versa.
A convenience type for expressing a PipePair which has the same types for commands and events.
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.
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.
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.
This pipeline stage does not alter the events or commands
This class contains static factory methods which produce PipePair instances; those are needed within the implementation of PipelineStage#apply.
This class contains static factory methods which turn a pipeline context and a PipelineStage into readily usable pipelines.
Java API: A pair of pipes, one for commands and one for events. Commands travel from top to bottom, events from bottom to top.
PipePairFactory
AbstractSymmetricPipePair
PipelineStage