map
Transform each element in the stream by calling a mapping function with it and passing the returned value downstream.
Simple operators
Signature
def map [ T ]( f : Out => T ): Repr [ T ]
Description
Transform each element in the stream by calling a mapping function with it and passing the returned value downstream.
emits when the mapping function returns an element
backpressures when downstream backpressures
completes when upstream completes
Examples
Scala
copy source import akka . NotUsed
import akka . stream . scaladsl . _
val source : Source [ Int , NotUsed ] = Source ( 1 to 10 )
val mapped : Source [ String , NotUsed ] = source . map ( elem => elem . toString )
Found an error in this documentation? The source code for this page can be found
here .
Please feel free to edit and contribute a pull request.