Skip to content

Instantly share code, notes, and snippets.

@Shiti
Created October 18, 2014 13:16
Show Gist options
  • Save Shiti/993de3071fb2c0eb2e13 to your computer and use it in GitHub Desktop.
Save Shiti/993de3071fb2c0eb2e13 to your computer and use it in GitHub Desktop.
Akka-Stream example using experimental version 0.9
package sample.stream
import akka.actor.ActorSystem
import akka.stream.MaterializerSettings
import akka.stream.scaladsl2._
object BasicTransformation {
def main(args: Array[String]): Unit = {
implicit val system = ActorSystem("Sys")
val settings = MaterializerSettings(system)
implicit val materializer = FlowMaterializer(settings)
val text =
"""|Lorem Ipsum is simply dummy text of the printing and typesetting industry.
|Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
|when an unknown printer took a galley of type and scrambled it to make a type
|specimen book.""".stripMargin
val in = text.split("\\s").toIterator
IteratorTap(in).map(_.toUpperCase).map(println(_)).connect(BlackholeDrain).run()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment