Re: [akka-user] persistAll()

2017-04-14 Thread Justin du coeur
Already fixed, actually. I'm still on 2.4, so that's the API doc I was looking at, but when I check over at 2.5 this has been clarified... On Fri, Apr 14, 2017 at 11:58 AM, Patrik Nordwall wrote: > If this is missing or unclear in docs it would be great with an >

Re: [akka-user] persistAll()

2017-04-14 Thread ahjohannessen
The durables.isEmpty check was due to a bug in persistAll at the time that code was written. I think it has been fixed by now. On Friday, April 14, 2017 at 4:54:22 PM UTC+1, ahjohannessen wrote: > > I am correct, try it out. We do something like this: > > def processEvents(events:

Re: [akka-user] persistAll()

2017-04-14 Thread Patrik Nordwall
If this is missing or unclear in docs it would be great with an improvement PR. fre 14 apr. 2017 kl. 17:54 skrev ahjohannessen : > I am correct, try it out. We do something like this: > > def processEvents(events: Seq[DomainEvent], cm: CommandMessage) >

Re: [akka-user] persistAll()

2017-04-14 Thread ahjohannessen
I am correct, try it out. We do something like this: def processEvents(events: Seq[DomainEvent], cm: CommandMessage) (done: ⇒ Unit): Unit = { val durables = events map { e ⇒ DurableEvent(e).causedBy(cm) } if(durables.isEmpty) done else {

Re: [akka-user] persistAll()

2017-04-14 Thread Justin du coeur
Huh -- from the documentation I wouldn't have expected that to work. (The docs for deferAsync only talk about using it with persistAsync(), not persist().) But from looking at the code for Eventsourced, it seems like you're probably correct. Excellent -- thanks! On Thu, Apr 13, 2017 at 8:38

[akka-user] persistAll()

2017-04-13 Thread ahjohannessen
Use deferAsync after persistAll -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> Search the archives: https://groups.google.com/group/akka-user --- You received this message

[akka-user] persistAll()

2017-04-13 Thread Justin du coeur
I just realized that I have been misusing PersistentActor.persistAll() for quite some time now -- the only reason it hasn't produced horrible bugs is because I haven't yet used it for more than a single Event at a time. (And foolishly didn't check my types properly.) I had assumed it called its