-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Http2 incoming-side stream state machine #1064
Refactor Http2 incoming-side stream state machine #1064
Conversation
Test PASSed. |
state: StreamState, | ||
outlet: Option[BufferedOutlet[ByteString]] | ||
) | ||
override protected def logSource: Class[_] = classOf[Http2ServerDemux] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -81,14 +78,10 @@ class Http2ServerDemux extends GraphStage[BidiShape[Http2SubStream, FrameEvent, | |||
BidiShape(substreamIn, frameOut, frameIn, substreamOut) | |||
|
|||
def createLogic(inheritedAttributes: Attributes): GraphStageLogic = | |||
new GraphStageLogic(shape) with GenericOutletSupport with Http2MultiplexerSupport with StageLogging { | |||
new GraphStageLogic(shape) with Http2MultiplexerSupport with Http2StreamHandling with GenericOutletSupport with StageLogging { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, I like these kinds of splitting up with traits 👍
case object Closed extends IncomingStreamState { | ||
def handle(event: StreamFrameEvent): IncomingStreamState = receivedUnexpectedFrame(event) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nicely modeled states 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice refactor, happy to merge this so we can put other work on top of it - WDYT?
It's now in its own file and handle StreamFrameEvents depending on the state of a stream.
Refs #1053.