+per #13944 Send RecoveryComplete message at end of recovery
Fixes #13944 Conflicts: akka-docs/rst/scala/code/docs/persistence/PersistenceDocSpec.scala akka-persistence/src/main/scala/akka/persistence/Processor.scala project/AkkaBuild.scala
This commit is contained in:
parent
3c9483520a
commit
9bcaeff87d
14 changed files with 223 additions and 81 deletions
|
|
@ -21,6 +21,8 @@ trait PersistenceDocSpec {
|
|||
//#auto-update
|
||||
"""
|
||||
|
||||
trait SomeOtherMessage
|
||||
|
||||
val system: ActorSystem
|
||||
|
||||
import system._
|
||||
|
|
@ -35,7 +37,7 @@ trait PersistenceDocSpec {
|
|||
// message successfully written to journal
|
||||
case PersistenceFailure(payload, sequenceNr, cause) =>
|
||||
// message failed to be written to journal
|
||||
case other =>
|
||||
case m: SomeOtherMessage =>
|
||||
// message not written to journal
|
||||
}
|
||||
}
|
||||
|
|
@ -87,20 +89,12 @@ trait PersistenceDocSpec {
|
|||
|
||||
class MyProcessor4 extends Processor {
|
||||
//#recovery-completed
|
||||
override def preStart(): Unit = {
|
||||
super.preStart()
|
||||
self ! "FIRST"
|
||||
}
|
||||
|
||||
def receive = initializing.orElse(active)
|
||||
def receive = initializing
|
||||
|
||||
def initializing: Receive = {
|
||||
case "FIRST" =>
|
||||
case RecoveryCompleted =>
|
||||
recoveryCompleted()
|
||||
context.become(active)
|
||||
unstashAll()
|
||||
case other if recoveryFinished =>
|
||||
stash()
|
||||
}
|
||||
|
||||
def recoveryCompleted(): Unit = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue