c

akka.projection.scaladsl

StatefulHandler

abstract class StatefulHandler[State, Envelope] extends Handler[Envelope]

Source
StatefulHandler.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. StatefulHandler
  2. Handler
  3. HandlerLifecycle
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new StatefulHandler()(implicit ec: ExecutionContext)

Abstract Value Members

  1. abstract def initialState(): Future[State]

    Invoked to load the initial state when the projection is started or if previous process failed.

  2. abstract def process(state: State, envelope: Envelope): Future[State]

    The process method is invoked for each Envelope.

    The process method is invoked for each Envelope. One envelope is processed at a time. The returned Future[State] is to be completed when the processing of the envelope has finished. It will not be invoked with the next envelope until after the returned Future has been completed.

    The state is the completed value of the previously returned Future[State] or the initialState. If the previously returned Future[State] failed it will call initialState again and use that value.

Concrete Value Members

  1. final def process(envelope: Envelope): Future[Done]

    Calls process(state, envelope) with the completed value of the previously returned Future[State] or the initialState.

    Calls process(state, envelope) with the completed value of the previously returned Future[State] or the initialState. If the previously returned Future[State] failed it will call initialState again and use that value.

    Definition Classes
    StatefulHandlerHandler
  2. final def start(): Future[Done]

    Calls StatefulHandler.initialState when the projection is started.

    Calls StatefulHandler.initialState when the projection is started.

    Definition Classes
    StatefulHandlerHandlerLifecycle
  3. 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