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
- Alphabetic
- By Inheritance
- ActorHandler
- Handler
- HandlerLifecycle
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def process(actor: ActorRef[T], envelope: Envelope): CompletionStage[Done]
The
process
method is invoked for eachEnvelope
.The
process
method is invoked for eachEnvelope
. One envelope is processed at a time. The returnedCompletionStage
is to be completed when the processing of theenvelope
has finished. It will not be invoked with the next envelope until after the returnedCompletionStage
has been completed.The
behavior
is spawned when theProjection
is started and theActorRef
is passed in as a parameter here.You will typically use the
AskPattern.ask
to delegate the processing of theenvelope
to the actor and the returnedCompletionStage
corresponds to the reply of theask
.- 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
- val behavior: Behavior[T]
- 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]
The
process
method is invoked for eachEnvelope
.The
process
method is invoked for eachEnvelope
. One envelope is processed at a time. The returnedCompletionStage
is to be completed when the processing of theenvelope
has finished. It will not be invoked with the next envelope until after the returnedCompletionStage
has been completed.- Definition Classes
- ActorHandler → Handler
- 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
- 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
Projection
is 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])