On Sun, Oct 25, 2015 at 2:41 AM, Maatary Okouya <maatarioko...@gmail.com>
wrote:

>
> Hi,
>
>
> in the AKKA Doc on persistent actor, what is the purpose of <<notifying
> others about successful state changes by publishing events>>  in:
>
> =>>The main responsibility of an event handler is changing persistent
> actor state using event data and notifying others about successful state
> changes by publishing events.
>
> It is related to:
>
>
>    1. persist(Evt(s"${data}-${numEvents + 1}")) { event =>
>    2. updateState(event)
>    3. context.system.eventStream.publish(event)
>    4. }
>
>
>
> A - What could be a possible use case for this ?
>
> B - Could someone issue new *Command *in that call back ? let say to
> other actor ?
>
> C - Let say the Actor here is a ShoppingCard Actor and it communicate with
> an Inventory Actor and a Credit CarProcessor Actor, Would they consumer
> that event, to do their work ? synchronize their state ? Or shall they
> receive new command ? What would be the best place to communicate with them
> ? That call back ? by sending command, or publishing the event, to the bus
> as above.
>

I would say that publishing to the local eventStream is just one way of
doing it. You can send direct messages also. Depends on your application.
Another way to consume the events is to read them from the journal
with the Persistence
Query <http://doc.akka.io/docs/akka/2.4.0/scala/persistence-query.html>
module.

/Patrik


>
>
> Many thanks,
>
> Maatari
>
>
>
> --
> >>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
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