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 {
      persistAll(durables)(applyEvent)
      deferAsync()(_ ⇒ done)
    }

  }


On Friday, April 14, 2017 at 2:16:09 PM UTC+1, Justin du coeur wrote:
>
> 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 PM, ahjohannessen <[email protected] 
> <javascript:>> wrote:
>
>> 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 because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
>>>>>>>>>>      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 because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to