I have the following simple class hierarchy:
sealed trait Message case class Foo(bar: Int) extends Message case class Baz(qux: String) extends Message
And I have Flow[Message, Message, NotUsed]
(from a protocol based on Websocket with a codec already installed).
I want to demultiplex this Flow[Message]
into separate threads for the Foo and Baz types, since they are processed in completely different ways.
What is the easiest way to do this? It should be obvious, but I'm missing something ...
source share