Coordinating Typed Actors

Typed actors, as we saw in Using Typed Actors, are a glamour child of object-oriented programming and actor-based programming. They bring together the all-too-familiar, convenient method calls and the benefits of actors. So, in an OO-application, instead of using actors, we may be tempted to use typed actors. However, just like actors, typed actors run in isolation and don’t provide transactional coordination—we’ll have to use coordinating typed actors for that.

Akka makes it really simple to make a typed actor a coordinating typed actor; we simply have to mark the corresponding interface methods with a special Coordinated annotation. To indicate that a sequence of calls should run under a coordinated transaction, ...

Get Programming Concurrency on the JVM now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.