Package

org.squbs

streams

Permalink

package streams

Visibility
  1. Public
  2. All

Type Members

  1. final class Deduplicate[T, U] extends SimpleLinearGraphStage[T]

    Permalink

    Only pass on those elements that have not been seen so far.

    Only pass on those elements that have not been seen so far.

    Emits when the element is not a duplicate

    Backpressures when the element is not a duplicate and downstream backpressures

    Completes when upstream completes

    Cancels when downstream cancels

  2. case class FlowTimeoutException(msg: String = "Flow timed out!") extends TimeoutException with Product with Serializable

    Permalink

    Exception thrown when an element times out.

    Exception thrown when an element times out.

    msg

    Defaults to "Flow timed out!"

  3. case class MutableLong(value: Long = 0L) extends Product with Serializable

    Permalink

    MutableLong is used to avoid boxing/unboxing and also to avoid java.util.Map#put operation to increment the counters in the registry.

  4. final class RetryBidi[In, Out, Context] extends GraphStage[BidiShape[(In, Context), (In, Context), (Try[Out], Context), (Try[Out], Context)]]

    Permalink

    A bidi GraphStage that can be joined with flows that produce Try's to add Retry functionality when there are any failures.

    A bidi GraphStage that can be joined with flows that produce Try's to add Retry functionality when there are any failures. When the joined Flow has a failure then based on the provided max retries count, it will retry the failures.

    Emits when a Success is available from joined flow or a failure has been retried the maximum number of retries

    Backpressures when the element is not a failure and downstream backpressures or the retry buffer is full

    Completes when upstream completes

    Cancels when downstream cancels

             upstream      +------+      downstream
          (In, Context) ~> |      | ~> (In, Context)
               In1         | bidi |        Out1
    (Try[Out], Context) <~ |      | <~ (Try[Out], Context)
              Out2         +------+        In2
    In

    the type of elements pulled from the upstream along with the Context

    Out

    the type of the elements that are pushed by the joined Flow along with the Context. This then gets wrapped with a Try and pushed downstream with a Context

    Context

    the type of the context that is carried around along with the elements.

  5. final class TimeoutBidiOrdered[In, Out] extends GraphStage[BidiShape[In, In, Out, Try[Out]]]

    Permalink

    A bidi GraphStage that is joined with flows to add timeout functionality.

    A bidi GraphStage that is joined with flows to add timeout functionality. This bidi stage is used with flows that guarantee the message ordering.

    Emits when an element is available from the wrapped flow or an element has already timed out

    Backpressures when the downstream backpressures

    Completes when upstream completes

    Cancels when downstream cancels

                +------+
          In ~> |      | ~> In
                | bidi |
    Try[Out] <~ |      | <~ Out
                +------+
    In

    the type of the elements pulled from the upstream and pushed down to joined flow

    Out

    the type of the elements that are pushed to downstream

  6. final class TimeoutBidiUnordered[In, Out, Context] extends GraphStage[BidiShape[(In, Context), (In, Context), (Out, Context), (Try[Out], Context)]] with LazyLogging

    Permalink

    A bidi GraphStage that is joined with flows to add timeout functionality.

    A bidi GraphStage that is joined with flows to add timeout functionality. This bidi stage is used with flows that do not guarantee the message ordering. So, it requires a context to be carried along with the elements to uniquely identify each element.

    Emits when an element is available from the joined Flow or an element has already timed out

    Backpressures when the downstream backpressures

    Completes when upstream completes

    Cancels when downstream cancels

                           +------+
          (In, Context) ~> |      | ~> (In, Context)
                           | bidi |
    (Try[Out], Context) <~ |      | <~ (Out, Context)
                           +------+
    In

    the type of the elements pulled from the upstream along with the Context

    Out

    the type of the elements that are pushed by the joined Flow along with the Context. This then gets wrapped with a Try and pushed downstream with a Context

    Context

    the type of the context that is carried around along with the elements.

  7. abstract class TimeoutGraphStageLogic[In, FromWrapped, Out] extends TimerGraphStageLogic

    Permalink

    A bidi GraphStageLogic that is used by TimeoutBidiOrdered and TimeoutBidiUnordered to wrap flows to add timeout functionality.

    A bidi GraphStageLogic that is used by TimeoutBidiOrdered and TimeoutBidiUnordered to wrap flows to add timeout functionality.

    Once an element is pushed from the wrapped flow (from fromWrapped), it first checks if the element is already timed out. If a timeout message has already been sent for that element to downstream, then the element from the wrapped flow is dropped.

    A timer gets scheduled when there is a downstream demand that's not immediately addressed. This is to make sure that a timeout response is sent to the downstream when upstream cannot address the demand on time.

    Timer precision is at best 10ms to avoid unnecessary timer scheduling cycles

           +------+
     In ~> |      | ~> In
           | bidi |
    Out <~ |      | <~ FromWrapped
           +------+
    In

    the type of the elements that gets forwarded to the wrapped flow

    FromWrapped

    the type of the elements that the wrapped flow sends back

    Out

    the type of the elements that are pushed to downstream

Ungrouped