Created
February 11, 2020 22:13
-
-
Save abdolence/648886f76a37656818e37dab186d557f to your computer and use it in GitHub Desktop.
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 fizzbuzz | |
import cloudflow.akkastream._ | |
import cloudflow.akkastream.scaladsl._ | |
import cloudflow.streamlets._ | |
import cloudflow.streamlets.avro._ | |
class FizzBuzzPrinter extends AkkaStreamlet { | |
val inlet = AvroInlet[FizzBuzzResult]( "in" ) | |
val shape = StreamletShape.withInlets( inlet ) | |
override def createLogic = new RunnableGraphStreamletLogic() { | |
def flow = { | |
FlowWithOffsetContext[FizzBuzzResult] | |
.map { result ⇒ | |
system.log.info( result.toString ) | |
result | |
} | |
} | |
def runnableGraph = { | |
sourceWithOffsetContext( inlet ).via( flow ).to( sinkWithOffsetContext ) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment