Packages

c

blended.streams

AckSourceLogic

abstract class AckSourceLogic[T <: AcknowledgeContext] extends TimerGraphStageLogic

Provide common logic for Source stages producing FlowEnvelopes requiring acknowledgement handling.

The AckSource logic encapsulates the underlying logic for an arbitrary Source of FlowEnvelopes. The envelopes will be passed down stream and must be acknowledged or denied eventually. An acknowledgement that takes too long, will be treated as a denial as well.

A concrete implementation must implement the actions to be executed upon acknowledgement and denial. For example, a JMS source would use a JMS acknowledge on the underlying JMS message and a session.recover() upon a denial. A file system based source may move or delete the original file upon acknowledge and restore the original file upon denial.

After picking up an envelope from an external system, the envelope will be considered to be inflight until either an acknowledge or deny has been called. The AckSource logic defines the maximum number of messages that can be inflight at any moment in time. No further messages will be pulled from the external system until a free inflight slot will become available.

Concrete implementations must:

- create and maintain any technical connections required to poll the external system - map the inbound data to a FlowEnvelope - implement the concrete actions for acknowledgement and denial

We will use an AcknowledgeContext to hold an inflight envelope and the id of the inflight slot it is using along with any additional that might be required to perform an acknowledge or denial.

As a result, each poll of the external system will produce an Option[AcknowledgeContext] which will then be inserted into a free inflight slot. As a consequence, polling of the external system will only be performed if and only if a free inflight slot is available.

As long as free inflight slots are available and no external messages are available, the poll will be executed \in regular intervals. Concrete implementations may overwrite the the nextPoll() method to modify the calculation of the next polling occurrence.

Linear Supertypes
TimerGraphStageLogic, GraphStageLogic, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AckSourceLogic
  2. TimerGraphStageLogic
  3. GraphStageLogic
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new AckSourceLogic(shape: Shape, out: Outlet[FlowEnvelope], ackTimeout: FiniteDuration)

Type Members

  1. class SubSinkInlet[T] extends AnyRef
    Definition Classes
    GraphStageLogic
  2. class SubSourceOutlet[T] extends AnyRef
    Definition Classes
    GraphStageLogic

Abstract Value Members

  1. abstract def doPerformPoll(id: String, ackHandler: AcknowledgeHandler): Try[Option[T]]
    Attributes
    protected
  2. abstract val id: String

    The id to identify the instance in the log files

    The id to identify the instance in the log files

    Attributes
    protected
  3. abstract val inflightSlots: List[String]

    The id's of the available inflight slots

    The id's of the available inflight slots

    Attributes
    protected
  4. abstract def log: FlowEnvelopeLogger

    A logger that must be defined by concrete implementations

    A logger that must be defined by concrete implementations

    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def abortEmitting(out: Outlet[_]): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  5. final def abortReading(in: Inlet[_]): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  6. def ackTimedOut(ackCtxt: T): Unit
    Attributes
    protected
  7. val ackTimeout: FiniteDuration
  8. def afterPostStop(): Unit
    Attributes
    protected[stream]
    Definition Classes
    TimerGraphStageLogic → GraphStageLogic
  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. val autoAcknowledge: Boolean
    Attributes
    protected
  11. def beforePreStart(): Unit
    Attributes
    protected[stream]
    Definition Classes
    GraphStageLogic
  12. final def cancel[T](in: Inlet[T], cause: Throwable): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  13. final def cancel[T](in: Inlet[T]): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  14. final def cancelStage(cause: Throwable): Unit
    Definition Classes
    GraphStageLogic
  15. final def cancelTimer(timerKey: Any): Unit
    Attributes
    protected
    Definition Classes
    TimerGraphStageLogic
  16. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  17. final def complete[T](out: Outlet[T]): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  18. final def completeStage(): Unit
    Definition Classes
    GraphStageLogic
  19. final def conditionalTerminateInput(predicate: () => Boolean): InHandler
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  20. final def conditionalTerminateOutput(predicate: () => Boolean): OutHandler
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  21. final def createAsyncCallback[T](handler: Procedure[T]): AsyncCallback[T]
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  22. def determineNextSlot(slotList: List[String]): Option[String]
    Attributes
    protected
  23. final def eagerTerminateInput: InHandler
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  24. final def eagerTerminateOutput: OutHandler
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  25. final def emit[T](out: Outlet[T], elem: T, andThen: Effect): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  26. final def emit[T](out: Outlet[T], elem: T): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  27. final def emit[T](out: Outlet[T], elem: T, andThen: () => Unit): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  28. final def emitMultiple[T](out: Outlet[T], elems: Iterator[T]): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  29. final def emitMultiple[T](out: Outlet[T], elems: Iterator[T], andThen: () => Unit): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  30. final def emitMultiple[T](out: Outlet[T], elems: Iterator[T], andThen: Effect): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  31. final def emitMultiple[T](out: Outlet[T], elems: Iterator[T]): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  32. final def emitMultiple[T](out: Outlet[T], elems: Iterable[T]): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  33. final def emitMultiple[T](out: Outlet[T], elems: Iterable[T], andThen: () => Unit): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  34. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  35. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  36. final def fail[T](out: Outlet[T], ex: Throwable): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  37. val fail: AsyncCallback[Throwable]
    Attributes
    protected
  38. final def failStage(ex: Throwable): Unit
    Definition Classes
    GraphStageLogic
  39. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  40. def freeInflightSlot(): Option[String]
    Attributes
    protected
  41. final def getAsyncCallback[T](handler: (T) => Unit): AsyncCallback[T]
    Definition Classes
    GraphStageLogic
  42. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  43. def getEagerStageActor(eagerMaterializer: Materializer, poisonPillCompatibility: Boolean)(receive: ((ActorRef, Any)) => Unit): StageActor
    Attributes
    protected[akka]
    Definition Classes
    GraphStageLogic
    Annotations
    @InternalApi()
  44. final def getHandler(out: Outlet[_]): OutHandler
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  45. final def getHandler(in: Inlet[_]): InHandler
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  46. final def getStageActor(receive: ((ActorRef, Any)) => Unit): StageActor
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  47. final def grab[T](in: Inlet[T]): T
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  48. final def hasBeenPulled[T](in: Inlet[T]): Boolean
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  49. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  50. final def ignoreTerminateInput: InHandler
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  51. final def ignoreTerminateOutput: OutHandler
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  52. val inCount: Int
    Definition Classes
    GraphStageLogic
  53. final def isAvailable[T](out: Outlet[T]): Boolean
    Definition Classes
    GraphStageLogic
  54. final def isAvailable[T](in: Inlet[T]): Boolean
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  55. final def isClosed[T](out: Outlet[T]): Boolean
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  56. final def isClosed[T](in: Inlet[T]): Boolean
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  57. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  58. final def isTimerActive(timerKey: Any): Boolean
    Attributes
    protected
    Definition Classes
    TimerGraphStageLogic
  59. def materializer: Materializer
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  60. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  61. def nextPoll(): Option[FiniteDuration]
    Attributes
    protected
  62. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  63. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  64. def onTimer(timerKey: Any): Unit
    Attributes
    protected
    Definition Classes
    AckSourceLogic → TimerGraphStageLogic
  65. val out: Outlet[FlowEnvelope]
  66. val outCount: Int
    Definition Classes
    GraphStageLogic
  67. final def passAlong[Out, In <: Out](from: Inlet[In], to: Outlet[Out], doFinish: Boolean, doFail: Boolean, doPull: Boolean): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  68. def pending(): Map[String, T]
    Attributes
    protected
  69. def poll(): Unit

    Poll the external system whether a new message is available.

    Poll the external system whether a new message is available. If a message can be polled without any exceptions, the resulting envelope will be wrapped in an AcknowledgeContext and returned. If no message is available, the result will be Success(None) * Any exception while polling for a message will deny all remaining inflight messages and then fail the stage.

    Attributes
    protected
  70. val pollImmediately: AsyncCallback[Unit]
    Attributes
    protected
  71. def postStop(): Unit
    Definition Classes
    AckSourceLogic → GraphStageLogic
  72. def preStart(): Unit
    Definition Classes
    AckSourceLogic → GraphStageLogic
  73. final def pull[T](in: Inlet[T]): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  74. final def push[T](out: Outlet[T], elem: T): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  75. final def read[T](in: Inlet[T], andThen: Procedure[T], onClose: Effect): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  76. final def read[T](in: Inlet[T])(andThen: (T) => Unit, onClose: () => Unit): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  77. final def readN[T](in: Inlet[T], n: Int, andThen: Procedure[List[T]], onClose: Procedure[List[T]]): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  78. final def readN[T](in: Inlet[T], n: Int)(andThen: (Seq[T]) => Unit, onClose: (Seq[T]) => Unit): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  79. final def scheduleAtFixedRate(timerKey: Any, initialDelay: Duration, interval: Duration): Unit
    Attributes
    protected
    Definition Classes
    TimerGraphStageLogic
  80. final def scheduleAtFixedRate(timerKey: Any, initialDelay: FiniteDuration, interval: FiniteDuration): Unit
    Attributes
    protected
    Definition Classes
    TimerGraphStageLogic
  81. final def scheduleOnce(timerKey: Any, delay: Duration): Unit
    Attributes
    protected
    Definition Classes
    TimerGraphStageLogic
  82. final def scheduleOnce(timerKey: Any, delay: FiniteDuration): Unit
    Attributes
    protected
    Definition Classes
    TimerGraphStageLogic
  83. final def scheduleWithFixedDelay(timerKey: Any, initialDelay: Duration, interval: Duration): Unit
    Attributes
    protected
    Definition Classes
    TimerGraphStageLogic
  84. final def scheduleWithFixedDelay(timerKey: Any, initialDelay: FiniteDuration, delay: FiniteDuration): Unit
    Attributes
    protected
    Definition Classes
    TimerGraphStageLogic
  85. final def setHandler(out: Outlet[_], handler: OutHandler): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  86. final def setHandler(in: Inlet[_], handler: InHandler): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  87. final def setHandlers(in: Inlet[_], out: Outlet[_], handler: InHandler with OutHandler): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  88. final def setKeepGoing(enabled: Boolean): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  89. val shape: Shape
  90. final def stageActor: StageActor
    Definition Classes
    GraphStageLogic
  91. def stageActorName: String
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  92. def subFusingMaterializer: Materializer
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  93. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  94. def toString(): String
    Definition Classes
    AnyRef → Any
  95. final def totallyIgnorantInput: InHandler
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  96. final def tryPull[T](in: Inlet[T]): Unit
    Attributes
    protected
    Definition Classes
    GraphStageLogic
  97. val updateAckState: AsyncCallback[(String, AckState)]
    Attributes
    protected
  98. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  99. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  100. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. final def schedulePeriodically(timerKey: Any, interval: Duration): Unit
    Attributes
    protected
    Definition Classes
    TimerGraphStageLogic
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scheduleWithFixedDelay or scheduleAtFixedRate instead. This has the same semantics as scheduleAtFixedRate, but scheduleWithFixedDelay is often preferred.

  2. final def schedulePeriodically(timerKey: Any, interval: FiniteDuration): Unit
    Attributes
    protected
    Definition Classes
    TimerGraphStageLogic
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scheduleWithFixedDelay or scheduleAtFixedRate instead. This has the same semantics as scheduleAtFixedRate, but scheduleWithFixedDelay is often preferred.

  3. final def schedulePeriodicallyWithInitialDelay(timerKey: Any, initialDelay: Duration, interval: Duration): Unit
    Attributes
    protected
    Definition Classes
    TimerGraphStageLogic
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scheduleWithFixedDelay or scheduleAtFixedRate instead. This has the same semantics as scheduleAtFixedRate, but scheduleWithFixedDelay is often preferred.

  4. final def schedulePeriodicallyWithInitialDelay(timerKey: Any, initialDelay: FiniteDuration, interval: FiniteDuration): Unit
    Attributes
    protected
    Definition Classes
    TimerGraphStageLogic
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scheduleWithFixedDelay or scheduleAtFixedRate instead. This has the same semantics as scheduleAtFixedRate, but scheduleWithFixedDelay is often preferred.

Inherited from TimerGraphStageLogic

Inherited from GraphStageLogic

Inherited from AnyRef

Inherited from Any

Ungrouped