public abstract static class Http2StreamHandling.StreamState
extends java.lang.Object
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 and Description |
---|
StreamState() |
protected Http2StreamHandling.StreamState dispatchStream(int streamId, FrameEvent.ParsedHeadersFrame headers, org.apache.pekko.util.ByteString initialData, scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> correlationAttributes, scala.Function1<Http2StreamHandling.IncomingStreamBuffer,Http2StreamHandling.StreamState> nextStateStream)
protected Http2StreamHandling.StreamState expectIncomingStream(FrameEvent.StreamFrameEvent event, Http2StreamHandling.StreamState nextStateEmpty, scala.Function1<Http2StreamHandling.IncomingStreamBuffer,Http2StreamHandling.StreamState> nextStateStream, scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> correlationAttributes)
public abstract Http2StreamHandling.StreamState handle(FrameEvent.StreamFrameEvent event)
public Http2StreamHandling.StreamState handleOutgoingCreated(Http2StreamHandling.OutStream outStream, scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> correlationAttributes)
public Http2StreamHandling.StreamState handleOutgoingCreatedAndFinished(scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> correlationAttributes)
public Http2StreamHandling.StreamState handleOutgoingEnded()
public Http2StreamHandling.StreamState handleOutgoingFailed(java.lang.Throwable cause)
public Http2StreamHandling.StreamState incomingStreamPulled()
public scala.Tuple2<Http2StreamHandling.StreamState,PullFrameResult> pullNextFrame(int maxSize)
public Http2StreamHandling.StreamState receivedUnexpectedFrame(FrameEvent.StreamFrameEvent e)
public void shutdown()
public java.lang.String stateName()