Hi Richard,

I think you have already noticed but your second proposal would not block
(stashing is not blocking, but it has same semantics in a sense that no
useful work can be done by an actor that is stashing) while persisting
state to DB.

Akka-persistence handles failure by sending PersistenceFailure message
which if unhandled
<https://github.com/akka/akka/blob/45449d7975792af6118959cb7e8a4c49b930a920/akka-persistence/src/main/scala/akka/persistence/Processor.scala#L322-L327>
would throw an exception and stop the actor (assuming default supervision
strategy).

On Tue, Nov 11, 2014 at 2:46 AM, Richard Rodseth <[email protected]> wrote:

> It must be frustrating for the Akka team to field questions when the
> solutions will be so much more elegant with Akka Persistence and Reactive
> Streams :)
>
> I have an aggregate which needs to respond to events by updating its own
> persistent state (using Slick) and firing a domain event.
>
> I believe that I should only fire the domain event after the state saving
> has succeeded. But this means that I must either
>
> 1) become(saving), tell a DbActor to save (with a replyTo and in the
> message), handle the success or failure response, become(ready) again
> or perhaps
> 2) use a per-request actor to do the saving and publishing of the domain
> event
> or
> 3) ?
>
> Does this seem reasonable? And how does Akka persistence handle the case
> when the event fails to persist?
>
> Thanks.
>
>
>  --
> >>>>>>>>>> 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 http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>      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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to