Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. val testSource = Source(1 until 50)
  2.  
  3. val processingFlow: Flow[Int, Int, NotUsed] = Flow[Int].mapAsyncUnordered(10)(x => Future {
  4. println(s"Kicking off $x")
  5. Thread.sleep(Random.nextInt(500))
  6. x * 10
  7. })
  8.  
  9. testSource.via(processingFlow).runWith(Sink.seq[Int])```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement