This is the companion repository for the Zalando Tech Blog post "Which shoe fits you? Comparing Akka Streams, Actors, and Plain Futures".
It provides a playground for playing around with the various ways of doing Scala concurrency. It can be used to familiarize yourself with the different concurrency concepts available to you in Scala.
The playground is based on an extremely simplified use case of having a cpu-bound computation first, and then publishing the result of it in an asynchronous way.
It currently explores the behavior of
- good-old blocking threads
- Scala Futures
- Actors
- Akka Streams
- RxScala
Of course, there are many more ways of doing the same things differently! I invite you to explore.
It uses JMH for benchmarking.
As a prerequisite for running this, you need to have SBT installed.
Then, clone the repo, run sbt
, and then for example:
jmh:run -wi 1 -i 5 .*Computation.*
See also the docs for the SBT JMH plugin and for JMH itself for more details about the options.
Explore, fiddle and most of all, have fun!
If you want to add another way of doing the same thing, please feel free to put up a pull request.
Copyright (c) 2016 Zalando SE
Licensed under the MIT License, see here.