O'Reilly logo

Actors in Scala by Frank Sommers, Philipp Haller

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

7.1 Pluggable schedulers

In some cases, you must customize the way in which actors are executed, including when:

  • Maintaining thread-bound properties such as ThreadLocals
  • Interfacing with existing event dispatch threads
  • Using daemon-style actors
  • Testing with deterministic execution of message sends/receives for reproducible testing
  • Maintaining fine-grained control over resources consumed by the underlying thread pool

The part of the runtime system that executes an actor's behavior is called a scheduler. Each actor is associated with a scheduler object that executes the actor's actions; that is, its body as well as its reactions to received messages. By default, a global scheduler executes all actors on a single thread pool. However, in principle ...

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