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()(implicit ec: ExecutionContext)
Abstract Value Members
- abstract def initialState(): Future[State]
Invoked to load the initial state when the projection is started or if previous
process
failed. - abstract def process(state: State, envelope: Envelope): Future[State]
The
process
method is invoked for eachEnvelope
.The
process
method is invoked for eachEnvelope
. One envelope is processed at a time. The returnedFuture[State]
is to be completed when the processing of theenvelope
has finished. It will not be invoked with the next envelope until after the returnedFuture
has been completed.The
state
is the completed value of the previously returnedFuture[State]
or theinitialState
. If the previously returnedFuture[State]
failed it will callinitialState
again and use that value.
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]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @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
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def process(envelope: Envelope): Future[Done]
Calls
process(state, envelope)
with the completed value of the previously returnedFuture[State]
or theinitialState
.Calls
process(state, envelope)
with the completed value of the previously returnedFuture[State]
or theinitialState
. If the previously returnedFuture[State]
failed it will callinitialState
again and use that value.- Definition Classes
- StatefulHandler → Handler
- final def start(): Future[Done]
Calls StatefulHandler.initialState when the projection is started.
Calls StatefulHandler.initialState when the projection is started.
- Definition Classes
- StatefulHandler → HandlerLifecycle
- def stop(): Future[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
Projection
is restarted after a failure.- Definition Classes
- HandlerLifecycle
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- 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()