Last active
March 20, 2019 20:54
-
-
Save LukeDefeo/7298b3a169773fa427c59dac328ba3cf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
val testSource = Source(1 until 50) | |
val processingFlow: Flow[Int, Int, NotUsed] = Flow[Int].mapAsyncUnordered(10)(x => Future { | |
println(s"Kicking off $x") | |
Thread.sleep(Random.nextInt(500)) | |
x * 10 | |
}) | |
testSource.via(processingFlow).runWith(Sink.seq[Int])``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment