One of the steps in my akka streams pipeline is a transformation that throws an exception when it receives an invalid input. I would like to discard these problematic inputs. So, I came up with the following solution:
...
.map( input => Try( transformation( input ) ).toOption )
.filter( _.nonEmpty )
.map( _.get )
...
Which takes 3 steps for what is, in fact, just a flatMap.
Is there a more straightforward akka way of doing this?