!per persistAsync
Breaks binary compatibility because adding new methods to Eventsourced trait. Since akka-persistence is experimental this is ok, yet source-level compatibility has been perserved thankfuly :-) Deprecates: * Rename of EventsourcedProcessor -> PersistentActor * Processor -> suggest using PersistentActor * Migration guide for akka-persistence is separate, as wel'll deprecate in minor versions (its experimental) * Persistent as well as ConfirmablePersistent - since Processor, their main user will be removed soon. Other changes: * persistAsync works as expected when mixed with persist * A counter must be kept for pending stashing invocations * Uses only 1 shared list buffer for persit / persistAsync * Includes small benchmark * Docs also include info about not using Persistent() wrapper * uses java LinkedList, for best performance of append / head on persistInvocations; the get(0) is safe, because these msgs only come in response to persistInvocations * Renamed internal *MessagesSuccess/Failure messages because we kept small mistakes seeing the class "with s" and "without s" as the same * Updated everything that refered to EventsourcedProcessor to PersistentActor, including samples Refs #15227 Conflicts: akka-docs/rst/project/migration-guides.rst akka-persistence/src/main/scala/akka/persistence/JournalProtocol.scala akka-persistence/src/main/scala/akka/persistence/Persistent.scala akka-persistence/src/test/scala/akka/persistence/PersistentActorSpec.scala project/AkkaBuild.scala
This commit is contained in:
parent
5f3d6029b1
commit
d51b79c95a
32 changed files with 907 additions and 134 deletions
|
|
@ -87,7 +87,7 @@ object PerformanceSpec {
|
|||
}
|
||||
}
|
||||
|
||||
class EventsourcedTestProcessor(name: String) extends PerformanceTestProcessor(name) with EventsourcedProcessor {
|
||||
class EventsourcedTestProcessor(name: String) extends PerformanceTestProcessor(name) with PersistentActor {
|
||||
val receiveRecover: Receive = {
|
||||
case _ ⇒ if (lastSequenceNr % 1000 == 0) print("r")
|
||||
}
|
||||
|
|
@ -100,7 +100,7 @@ object PerformanceSpec {
|
|||
}
|
||||
}
|
||||
|
||||
class StashingEventsourcedTestProcessor(name: String) extends PerformanceTestProcessor(name) with EventsourcedProcessor {
|
||||
class StashingEventsourcedTestProcessor(name: String) extends PerformanceTestProcessor(name) with PersistentActor {
|
||||
val receiveRecover: Receive = {
|
||||
case _ ⇒ if (lastSequenceNr % 1000 == 0) print("r")
|
||||
}
|
||||
|
|
@ -141,7 +141,7 @@ class PerformanceSpec extends AkkaSpec(PersistenceSpec.config("leveldb", "Perfor
|
|||
}
|
||||
}
|
||||
|
||||
def stressEventsourcedProcessor(failAt: Option[Long]): Unit = {
|
||||
def stressPersistentActor(failAt: Option[Long]): Unit = {
|
||||
val processor = namedProcessor[EventsourcedTestProcessor]
|
||||
failAt foreach { processor ! FailAt(_) }
|
||||
1 to warmupCycles foreach { i ⇒ processor ! s"msg${i}" }
|
||||
|
|
@ -153,7 +153,7 @@ class PerformanceSpec extends AkkaSpec(PersistenceSpec.config("leveldb", "Perfor
|
|||
}
|
||||
}
|
||||
|
||||
def stressStashingEventsourcedProcessor(): Unit = {
|
||||
def stressStashingPersistentActor(): Unit = {
|
||||
val processor = namedProcessor[StashingEventsourcedTestProcessor]
|
||||
1 to warmupCycles foreach { i ⇒ processor ! "b" }
|
||||
processor ! StartMeasure
|
||||
|
|
@ -195,13 +195,13 @@ class PerformanceSpec extends AkkaSpec(PersistenceSpec.config("leveldb", "Perfor
|
|||
|
||||
"An event sourced processor" should {
|
||||
"have some reasonable throughput" in {
|
||||
stressEventsourcedProcessor(None)
|
||||
stressPersistentActor(None)
|
||||
}
|
||||
"have some reasonable throughput under failure conditions" in {
|
||||
stressEventsourcedProcessor(Some(warmupCycles + loadCycles / 10))
|
||||
stressPersistentActor(Some(warmupCycles + loadCycles / 10))
|
||||
}
|
||||
"have some reasonable throughput with stashing and unstashing every 3rd command" in {
|
||||
stressStashingEventsourcedProcessor()
|
||||
stressStashingPersistentActor()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue