O'Reilly logo

Programming Concurrency on the JVM by Venkat Subramaniam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Actors in Groovy with GPars

To create actors, we have at least as many options in Groovy as in Java.

We can implement Akka actors in Groovy by extending Akka UntypedActor. Groovy allows us to extend from classes written in other JVM languages, so it’s a direct override of the onReceive method of UntypedActor. Within this method, we can check for the message type and perform appropriate actions.

We may also use one of the other actor frameworks available for Java. However, in this chapter we’ll use a concurrency library geared more toward Groovy—GPars.

GPars is a library written in Java that brings the love of programming concurrency to Groovy and Java. The Java’s performance and the sheer elegance of Groovy shine in GPars. It provides a number ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required