0PricingLogin
Scala for Backend Engineering & Functional Programming · Lesson

Transforming Streams

Map and filter flowing data.

Operators as Transformations

Akka Streams provides a rich set of operators on Source and Flow that mirror Scala's collection API but run asynchronously and respect backpressure.

Each operator returns a new blueprint, so transformations are composed declaratively before the stream ever runs.

map and filter

map applies a synchronous function to every element; filter drops elements that fail a predicate. These are the workhorses of element-wise transformation.

Both preserve ordering and propagate completion and failure downstream.

val flow =
  Flow[Int]
    .filter(_ % 2 == 0)
    .map(n => n * n)

All lessons in this course

  1. Source, Flow, and Sink
  2. Transforming Streams
  3. Backpressure
  4. Running a Pipeline
← Back to Scala for Backend Engineering & Functional Programming