Creating Actors

We have quite a few choices of actor libraries to pick from, as I mentioned earlier. In this book, we use Akka, a Scala-based library[21] with pretty good performance and scalability and with support for both actors and STM. We can use it from multiple languages on the JVM. In this chapter, we’ll stick to Java and Scala. In the next chapter, we’ll take a look at using Akka actors with other languages.

Akka was written in Scala, so it’s quite simple and more natural to create and use actors from Scala. Scala conciseness and idioms shine in the Akka API. At the same time, they’ve done quite a wonderful job of exposing a traditional Java API so we can easily create and use actors in Java code. We’ll first take a look at using it ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.