+act add getEventStream to ActorSystem #25870
This commit is contained in:
parent
f66ee1cbe8
commit
e847ce016a
6 changed files with 26 additions and 21 deletions
|
|
@ -99,7 +99,7 @@ class ExamplePersistentActor extends AbstractPersistentActor {
|
|||
final Evt evt = new Evt(data + "-" + getNumEvents());
|
||||
persist(evt, (Evt e) -> {
|
||||
state.update(e);
|
||||
getContext().getSystem().eventStream().publish(e);
|
||||
getContext().getSystem().getEventStream().publish(e);
|
||||
if (lastSequenceNr() % snapShotInterval == 0 && lastSequenceNr() != 0)
|
||||
// IMPORTANT: create a copy of snapshot because ExampleState is mutable
|
||||
saveSnapshot(state.copy());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue