Contents
When should Akka be used?
Any system with the need for high-throughput and low latency is a good candidate for using Akka. Actors let you manage service failures (Supervisors), load management (back-off strategies, timeouts and processing-isolation), as well as both horizontal and vertical scalability (add more cores and/or add more machines).
What is futures in Akka?
In the Scala Standard Library, a Future is a data structure used to retrieve the result of some concurrent operation. This result can be accessed synchronously (blocking) or asynchronously (non-blocking). To be able to use this from Java, Akka provides a java friendly interface in akka.
Who uses Akka?
Of our 50 case studies and community stories, 39 of them (78%) are using Akka in production–happy clients include Walmart, Hootsuite, Huffington Post, WhitePages, Gilt, and Ticketfly.
What is future sequence?
This Future. sequence() function converts a list of Futures into a single Future that means collections of Futures into a single Future. In simple words, List[Future[T]] ======> Future[List[T]] . It is also known as composing Futures.
How do you stop an actor system?
You can stop actor system by calling it’s terminate method. This method will stop the guardian actor, which in turn will recursively stop all its child actors.
What does Akka stand for?
Akka is also the name of a goddess in the Sámi (the native Swedish population) mythology. She is the goddess that stands for all the beauty and good in the world. The mountain can be seen as the symbol of this goddess. Also, the name AKKA is a palindrome of the letters A and K as in Actor Kernel.
When to reuse the Akka futures dispatcher?
If the nature of the Future calls invoked by the actor matches or is compatible with the activities of that actor (e.g. all CPU bound and no latency requirements), then it may be easiest to reuse the dispatcher for running the Futures by importing context.dispatcher. // receive omitted
What are some common use cases for Akka?
A common use case within Akka is to have some computation performed concurrently without needing the extra utility of an Actor . If you find yourself creating a pool of Actor s for the sole reason of performing a calculation in parallel, there is an easier (and faster) way: import scala.concurrent.duration._
How does the mapto method in Akka work?
The mapTo method will return a new Future that contains the result if the cast was successful, or a ClassCastException if not. Handling Exception s will be discussed further within this documentation. To send the result of a Future to an Actor, you can use the pipe construct: