!per #3681 Performance and consistency improvements
- batch-write of persistent messages (user API) - batch-write of events (in EventsourcedProcessor) - command processing in EventsourcedProcessor by unstashing messages one-by-one from the internal stash * fixes performance issues that come up with unstashAll - commands are not looped through journal actor but processed directly - initial performance tests * command sourcing * event sourcing * event sourcing with user stash operations - suppress stack traces in tests
This commit is contained in:
parent
8eeaadfee0
commit
1da3369643
29 changed files with 1324 additions and 76 deletions
|
|
@ -225,4 +225,22 @@ trait PersistenceDocSpec {
|
|||
maxTimestamp = System.currentTimeMillis))
|
||||
//#snapshot-criteria
|
||||
}
|
||||
|
||||
new AnyRef {
|
||||
import akka.actor.Props
|
||||
//#batch-write
|
||||
class MyProcessor extends Processor {
|
||||
def receive = {
|
||||
case Persistent("a", _) ⇒ // ...
|
||||
case Persistent("b", _) ⇒ // ...
|
||||
}
|
||||
}
|
||||
|
||||
val system = ActorSystem("example")
|
||||
val processor = system.actorOf(Props[MyProcessor])
|
||||
|
||||
processor ! PersistentBatch(Vector(Persistent("a"), Persistent("b")))
|
||||
//#batch-write
|
||||
system.shutdown()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ package docs.persistence
|
|||
|
||||
//#plugin-imports
|
||||
import scala.concurrent.Future
|
||||
import scala.collection.immutable.Seq
|
||||
//#plugin-imports
|
||||
|
||||
import com.typesafe.config._
|
||||
|
|
@ -69,6 +70,7 @@ class PersistencePluginDocSpec extends WordSpec {
|
|||
|
||||
class MyJournal extends AsyncWriteJournal {
|
||||
def writeAsync(persistent: PersistentImpl): Future[Unit] = ???
|
||||
def writeBatchAsync(persistentBatch: Seq[PersistentImpl]): Future[Unit] = ???
|
||||
def deleteAsync(persistent: PersistentImpl): Future[Unit] = ???
|
||||
def confirmAsync(processorId: String, sequenceNr: Long, channelId: String): Future[Unit] = ???
|
||||
def replayAsync(processorId: String, fromSequenceNr: Long, toSequenceNr: Long)(replayCallback: (PersistentImpl) ⇒ Unit): Future[Long] = ???
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue