Skip to content

Instantly share code, notes, and snippets.

Created April 18, 2017 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/8d774070008eea5c08aca84bdb9e3cb1 to your computer and use it in GitHub Desktop.
Save anonymous/8d774070008eea5c08aca84bdb9e3cb1 to your computer and use it in GitHub Desktop.
the description for this gist
val source = Source((1 to 10).toList)
// instantiate newly created MyFilterGraphStage:
val myFilterStage = new MyFilterGraphStage[Int](_ % 2 == 0)
// create Flow out of graph:
val myFilter = Flow.fromGraph(myFilterStage)
source.via(myFilter).runForeach(println)
@2m
Copy link

2m commented May 8, 2017

Definition of source can be simplified to Source(1 to 10) to keep cognitive overloading to minimum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment