Skip to content

Instantly share code, notes, and snippets.

/post.scala

Created Apr 18, 2017
Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@2m 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