I think you need to look into saga pattern which is actor model analogue of 
(distributed) transactions. It has the advantage that the parties involved 
in the transaction do not need to be present on the same VM (cluster node 
etc.) which is a prerequisite for STM / Agents.

Cheers,
Rafał

W dniu piątek, 27 stycznia 2017 18:58:37 UTC+1 użytkownik scala solist 
napisał:
>
> Thanks for the reply! I'm currently implemented some plain and simple 
> observable variable model atop of normal actors. Actor could control 
> immutable state, it accepts update messages that contains write lenses and 
> applies them. It manages subscriptions to the changes where subscriber 
> provide read lens and if it had changed - new value is sent. Immutable data 
> structures as well as rough subscriptions are not very effective, but I has 
> no need in computational efficiency.
>
> The problem is what should I do, when I have two actors (or agents as you 
> have suggested) and want them to do coordinated updates to both. There was 
> transaction model in the older releases, and now I need to replace it. Is 
> there any existing library in the ecosystem, or should I write it myself?
>
> On Friday, January 13, 2017 at 7:23:01 PM UTC+3, Konrad Malawski wrote:
>>
>> You can just use the Agents as was explained in my previous email. 
>> We're moving them out, shouldn't really stop you from using it.
>>
>> If you want to officially maintain them let us know.
>>
>> -- 
>> Konrad `ktoso` Malawski
>> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>>
>> On 13 January 2017 at 16:46:30, Konrad Malawski (konrad....@lightbend.com) 
>> wrote:
>>
>> Correction, Agents are not gone. They will be deprecated in 2.5, they are 
>> present in 2.4.
>>
>> Just Actors ;-)
>>
>> More is documented in the upcoming migration docs:
>>
>> https://github.com/akka/akka/blob/master/akka-docs/rst/project/migration-guide-2.4.x-2.5.x.rst#agents-are-now-deprecated
>>
>>
>> Agents are now deprecated 
>>
>> Akka Agents are a very simple way of containing mutable state and 
>> allowing to access it safely from multiple threads. The abstraction is 
>> leaky though, as Agents do not work over the network (unlike Akka Actors).
>>
>> As users were often confused by "when to use an Actor vs. when to use an 
>> Agent?" a decision was made to deprecate the Agents, as they rarely are 
>> really enough and do not fit the Akka spirit of thinking about 
>> distribution. We also anticipate to replace the uses of Agents by the 
>> upcoming Akka Typed, so in preparation thereof the Agents have been 
>> deprecated in 2.5.
>>
>> If you use Agents and would like to take over the maintanance thereof, 
>> please contact the team on gitter or github.
>>
>> -- 
>> Konrad `ktoso` Malawski
>> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>>
>> On 13 January 2017 at 16:42:37, scala solist (scala...@gmail.com) wrote:
>>
>> Sometimes you need to do coordinated work between actors and modify 
>> shared state. The state in broad sense is separated by actors, there is no 
>> need to share them all. But sometimes there is a need to share small chunk 
>> of state and work with it with several actors. How it should be done in the 
>> recent akka?
>> --
>> >>>>>>>>>> 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+...@googlegroups.com.
>> To post to this group, send email to akka...@googlegroups.com.
>> 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
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