abstract class ActorHandler[Envelope, T] extends Handler[Envelope]

This Handler gives support for spawning an actor of a given Behavior to delegate processing of the envelopes to the actor.

The lifecycle of the actor is managed by the Projection. The behavior is spawned when the Projection is started and the ActorRef is passed in as a parameter to the process method. The Actor is stopped when the Projection is stopped.

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

Instance Constructors

  1. new ActorHandler(behavior: Behavior[T])

Abstract Value Members

  1. abstract def process(actor: ActorRef[T], envelope: Envelope): CompletionStage[Done]

    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 CompletionStage 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 CompletionStage has been completed.

    The behavior is spawned when the Projection is started and the ActorRef is passed in as a parameter here.

    You will typically use the AskPattern.ask to delegate the processing of the envelope to the actor and the returned CompletionStage corresponds to the reply of the ask.

    Annotations
    @throws(classOf[Exception])

Concrete Value Members

  1. val behavior: Behavior[T]
  2. final def process(envelope: Envelope): CompletionStage[Done]

    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 CompletionStage 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 CompletionStage has been completed.

    Definition Classes
    ActorHandlerHandler
  3. def start(): CompletionStage[Done]

    Invoked when the projection is starting, before first envelope is processed.

    Invoked when the projection is starting, before first envelope is processed. Can be overridden to implement initialization. It is also called when the Projection is restarted after a failure.

    Definition Classes
    HandlerHandlerLifecycle
  4. 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 Projection is restarted after a failure.

    Definition Classes
    HandlerHandlerLifecycle