Elements of the Akka Streams flow are usually defined using constructors of the appropriate type. We'll implement building blocks which constitute our diagram one by one, starting with the simplest and moving on to the increasingly complex as we go over them.
Basics of Akka Streams
Sources and sinks
The simplest component of our flow is possibly the Consumer. It is just a sink which is supposed to print out information about incoming data. To construct it, we'll use the Sink factory, as follows:
val consumer: Sink[ReadyCookies, Future[Done]] =
Sink.foreach(cookie => println(s"$cookie, yummi..."))
The Sink factory offers more than two dozens different constructors to define a sink. We're utilizing...