abstract class StatefulHandler[State, Envelope] extends Handler[Envelope]
- Annotations
- @ApiMayChange()
- Source
- StatefulHandler.scala
- Alphabetic
- By Inheritance
- StatefulHandler
- Handler
- HandlerLifecycle
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new StatefulHandler()
Abstract Value Members
- abstract def initialState(): CompletionStage[State]
Invoked to load the initial state when the projection is started or if previous
processfailed. - abstract def process(state: State, envelope: Envelope): CompletionStage[State]
The
processmethod is invoked for eachEnvelope.The
processmethod is invoked for eachEnvelope. One envelope is processed at a time. The returnedCompletionStage<State>is to be completed when the processing of theenvelopehas finished. It will not be invoked with the next envelope until after the returnedCompletionStagehas been completed.The
stateis the completed value of the previously returnedCompletionStage<State>or theinitialState. If the previously returnedCompletionStage<State>failed it will callinitialStateagain and use that value.- Annotations
- @throws(classOf[Exception])
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def process(envelope: Envelope): CompletionStage[Done]
Calls
process(state, envelope)with the completed value of the previously returnedCompletionStage<State>or theinitialState.Calls
process(state, envelope)with the completed value of the previously returnedCompletionStage<State>or theinitialState. If the previously returnedCompletionStage<State>failed it will callinitialStateagain and use that value.- Definition Classes
- StatefulHandler → Handler
- final def start(): CompletionStage[Done]
Calls StatefulHandler.initialState when the projection is started.
Calls StatefulHandler.initialState when the projection is started.
- Definition Classes
- StatefulHandler → Handler → HandlerLifecycle
- def stop(): CompletionStage[Done]
Invoked when the projection has been stopped.
Invoked when the projection has been stopped. Can be overridden to implement resource cleanup. It is also called when the
Projectionis restarted after a failure.- Definition Classes
- Handler → HandlerLifecycle
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])