Class Http2StreamHandling.StreamState
- Direct Known Subclasses:
- Http2StreamHandling.Closed$,- Http2StreamHandling.HalfClosedLocalWaitingForPeerStream,- Http2StreamHandling.HalfClosedRemoteSendingData,- Http2StreamHandling.HalfClosedRemoteWaitingForOutgoingStream,- Http2StreamHandling.Idle$,- Http2StreamHandling.OpenSendingData,- Http2StreamHandling.ReceivingData
- Enclosing interface:
- Http2StreamHandling
Substates were introduced to also track the state of our user-side
States: * Idle | server | client <- Idle, initial state, usually not tracked explicitly * OpenReceivingDataFirst | server <- Open, got (request) HEADERS but didn't send (response) HEADERS yet * OpenSendingData | client <- Open, sent (request) HEADERS but didn't receive (response) HEADERS yet * Open | server | client <- Open, bidirectional, both sides sent HEADERS * HalfClosedLocalWaitingForPeerStream | client <- HalfClosedLocal, our stream side done, waiting for peer HEADERS * HalfClosedLocal | server | client <- HalfClosedLocal, all HEADERS sent, sent our endStream = true, receiving DATA from peer * HalfClosedRemoteWaitingForOutgoingStream | server <- HalfClosedRemote, waiting for our HEADERS from user * HalfClosedRemoteSendingData | server | client <- HalfClosedRemote, sent our HEADERS, now sending out DATA * Closed | server | client <- Closed, final state, not tracked explicitly
Server states: * Idle -> OpenReceivingDataFirst: on receiving request HEADERS with endStream = false * Idle -> HalfClosedRemoteWaitingForOutgoingStream: on receiving HEADERS with endStream = true * OpenReceivingDataFirst -> HalfClosedRemoteWaitingForOutgoingStream: after receiving endStream * OpenReceivingDataFirst -> Open: after user provided response before request was fully streamed in * HalfClosedRemoteWaitingForOutgoingStream -> HalfClosedRemoteSendingData: we sent response HEADERS with endStream = false * HalfClosedRemoteWaitingForOutgoingStream -> Closed: we sent response HEADERS with endStream = true * HalfClosedRemoteSendingData -> Closed: we sent DATA with endStream = true * Open -> HalfClosedRemoteSendingData: on receiving request DATA with endStream = true * Open -> HalfClosedLocal: on receiving response DATA with endStream = true before request has been fully received (uncommon) * HalfClosedLocal -> Closed: on receiving request DATA with endStream = true
Client states: * Idle -> OpenSendingData: on sending out (request) HEADERS with endStream = false * Idle -> HalfClosedLocalWaitingForPeerStream: on sending out (request) HEADERS with endStream = true * OpenSendingData -> HalfClosedLocalWaitingForPeerStream: on sending out DATA with endStream = true * OpenSendingData -> Open: on receiving response HEADERS before request DATA was fully sent out * HalfClosedLocalWaitingForPeerStream -> HalfClosedLocal: on receiving response HEADERS with endStream = false * HalfClosedLocalWaitingForPeerStream -> Closed: on receiving response HEADERS with endStream = true * HalfClosedLocal -> Closed: on receiving response DATA with endStream = true * Open -> HalfClosedLocal: on sending out request DATA with endStream = true * Open -> HalfClosedRemoteSendingData: on receiving response DATA with endStream = true before request has been fully sent out (uncommon) * HalfClosedRemoteSendingData -> Closed: on sending out request DATA with endStream = true
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected Http2StreamHandling.StreamStatedispatchStream(int streamId, FrameEvent.ParsedHeadersFrame headers, org.apache.pekko.util.ByteString initialData, scala.collection.immutable.Map<AttributeKey<?>, Object> correlationAttributes, scala.Function1<Http2StreamHandling.IncomingStreamBuffer, Http2StreamHandling.StreamState> nextStateStream) protected Http2StreamHandling.StreamStateexpectIncomingStream(FrameEvent.StreamFrameEvent event, Http2StreamHandling.StreamState nextStateEmpty, scala.Function1<Http2StreamHandling.IncomingStreamBuffer, Http2StreamHandling.StreamState> nextStateStream, scala.collection.immutable.Map<AttributeKey<?>, Object> correlationAttributes) abstract Http2StreamHandling.StreamStatehandleOutgoingCreated(Http2StreamHandling.OutStream outStream, scala.collection.immutable.Map<AttributeKey<?>, Object> correlationAttributes) Called when we receive a user-created stream (that is open for more data)handleOutgoingCreatedAndFinished(scala.collection.immutable.Map<AttributeKey<?>, Object> correlationAttributes) Called when we receive a user-created stream that is already closedhandleOutgoingFailed(Throwable cause) scala.Tuple2<Http2StreamHandling.StreamState,PullFrameResult> pullNextFrame(int maxSize) voidshutdown()Called to cleanup any state when the connection is torn down
- 
Constructor Details- 
StreamStatepublic StreamState()
 
- 
- 
Method Details- 
dispatchStreamprotected Http2StreamHandling.StreamState dispatchStream(int streamId, FrameEvent.ParsedHeadersFrame headers, org.apache.pekko.util.ByteString initialData, scala.collection.immutable.Map<AttributeKey<?>, Object> correlationAttributes, scala.Function1<Http2StreamHandling.IncomingStreamBuffer, Http2StreamHandling.StreamState> nextStateStream) 
- 
expectIncomingStreamprotected Http2StreamHandling.StreamState expectIncomingStream(FrameEvent.StreamFrameEvent event, Http2StreamHandling.StreamState nextStateEmpty, scala.Function1<Http2StreamHandling.IncomingStreamBuffer, Http2StreamHandling.StreamState> nextStateStream, scala.collection.immutable.Map<AttributeKey<?>, Object> correlationAttributes) 
- 
handle
- 
handleOutgoingCreatedpublic Http2StreamHandling.StreamState handleOutgoingCreated(Http2StreamHandling.OutStream outStream, scala.collection.immutable.Map<AttributeKey<?>, Object> correlationAttributes) Called when we receive a user-created stream (that is open for more data)
- 
handleOutgoingCreatedAndFinishedpublic Http2StreamHandling.StreamState handleOutgoingCreatedAndFinished(scala.collection.immutable.Map<AttributeKey<?>, Object> correlationAttributes) Called when we receive a user-created stream that is already closed
- 
handleOutgoingEnded
- 
handleOutgoingFailed
- 
incomingStreamPulled
- 
pullNextFrame
- 
receivedUnexpectedFrame
- 
shutdownpublic void shutdown()Called to cleanup any state when the connection is torn down
- 
stateName
 
-