Created
December 28, 2016 12:12
-
-
Save muller/e42080cc2c96e2b016d059aa3af792dc 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
class CustomStage extends GraphStage[FlowShape[ByteString, ByteString]] { | |
val in = Inlet[ByteString]("CustomStage.in") | |
val out = Outlet[ByteString]("CustomStage.out") | |
override val shape = FlowShape.of(in, out) | |
override def createLogic(inheritedAttributes: Attributes): GraphStageLogic = new GraphStageLogic(shape) with InHandler with OutHandler { | |
setHandlers(in, out, this) | |
override def onPush() = emit(out, grab(in)) | |
override def onPull() = pull(in) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment