Working with Akka Streams is nothing less than pure pleasure. I can’t be thankful enough to the Akka team’s folks for this.
This post is just a little example of something I needed a little time figuring out myself. Amongst all the graph operators,
Partition is bizarrely not listed in the documentation at the moment of writing, even though I find it extremely useful. It lets you create some logic like that:
The example that follows is a very simple pipeline:
In this case the filter only had two outlets (even or odd numbers), but the graph stage lets you define your own custom logic with as many ports as needed. Very powerful!