Created
October 18, 2014 13:16
-
-
Save Shiti/993de3071fb2c0eb2e13 to your computer and use it in GitHub Desktop.
Akka-Stream example using experimental version 0.9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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