Book Image

Learning Akka

By : Jason Goodwin
Book Image

Learning Akka

By: Jason Goodwin

Overview of this book

<p>Software today has to work with more data, more users, more cores, and more servers than ever. Akka is a distributed computing toolkit that enables developers to build correct concurrent and distributed applications using Java and Scala with ease, applications that scale across servers and respond to failure by self-healing. As well as simplifying development, Akka enables multiple concurrency development patterns with particular support and architecture derived from Erlang’s concept of actors (lightweight concurrent entities). Akka is written in Scala, which has become the programming language of choice for development on the Akka platform.</p> <p>Learning Akka aims to be a comprehensive walkthrough of Akka. This book will take you on a journey through all the concepts of Akka that you need in order to get started with concurrent and distributed applications and even build your own.</p> <p>Beginning with the concept of Actors, the book will take you through concurrency in Akka. Moving on to networked applications, this book will explain the common pitfalls in these difficult problem areas while teaching you how to use Akka to overcome these problems with ease.</p> <p>The book is an easy to follow example-based guide that will strengthen your basic knowledge of Akka and aid you in applying the same to real-world scenarios.</p>
Table of Contents (17 chapters)
Learning Akka
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Index

Homework


  • Take the Akkademy DB from Chapter 2, Actors and Concurrency and implement a Connected Message—Have the client send a Ping and respond with Connected

  • Returning from the previous chapter, Instead of Ping and Connected messages, use Akka's Identify message using the preStart hook to determine if the remote actor is available. (See documentation.) Use this to acquire an ActorRef for a remote actor and use this instead of the ActorSelection.

  • Continuing to use Identity and an ActorRef, implement a connected state in the client using hotswap.

  • Every 2 seconds with the Identity message. Have the client restart if it misses 2 response

  • Instead of sending a ping and receiving a response, is it possible to have the client subscribe to a heartbeat message that is sent every two seconds?

  • Update the client to bunch messages using FSM. Do you think hotswap or FSM is more appropriate for this?

  • Implement supervision to have the actor log any restarts it encounters (such as two missed heartbeats)