2 Up and running

This chapter covers

  • Defining an actor and its behavior
  • Instantiating and sending messages to an actor
  • Keeping state in the actor with a variable
  • Keeping state in the actor with its behavior
  • Scheduling sending a message

This chapter covers in practice the basic parts of Akka from the previous chapter: creating an actor, sending messages to actors, and setting actors’ behavior. It also explains how to handle state and send messages with a scheduled delay.

Without further ado, let’s start with a minimal Akka application: a wallet into which you can deposit money. This can be part of a larger application that handles betting on sports events with money from the wallet. You learn how to create such a betting application later in ...

Get Akka in Action, Second Edition 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.