Class Http2StreamHandling.StreamState
- java.lang.Object
-
- akka.http.impl.engine.http2.Http2StreamHandling.StreamState
-
- Direct Known Subclasses:
Http2StreamHandling.Closed$
,Http2StreamHandling.HalfClosedLocalWaitingForPeerStream
,Http2StreamHandling.HalfClosedRemoteSendingData
,Http2StreamHandling.HalfClosedRemoteWaitingForOutgoingStream
,Http2StreamHandling.Idle$
,Http2StreamHandling.OpenSendingData
,Http2StreamHandling.ReceivingData
- Enclosing interface:
- Http2StreamHandling
public abstract static class Http2StreamHandling.StreamState extends java.lang.Object
States roughly correspond to states as given in https://http2.github.io/http2-spec/#StreamStates.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 Summary
Constructors Constructor Description StreamState()
-
Method Summary
-
-
-
Method Detail
-
dispatchStream
protected Http2StreamHandling.StreamState dispatchStream(int streamId, FrameEvent.ParsedHeadersFrame headers, akka.util.ByteString initialData, scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> correlationAttributes, scala.Function1<Http2StreamHandling.IncomingStreamBuffer,Http2StreamHandling.StreamState> nextStateStream)
-
expectIncomingStream
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)
-
handle
public abstract Http2StreamHandling.StreamState handle(FrameEvent.StreamFrameEvent event)
-
handleOutgoingCreated
public Http2StreamHandling.StreamState handleOutgoingCreated(Http2StreamHandling.OutStream outStream, scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> correlationAttributes)
Called when we receive a user-created stream (that is open for more data)
-
handleOutgoingCreatedAndFinished
public Http2StreamHandling.StreamState handleOutgoingCreatedAndFinished(scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> correlationAttributes)
Called when we receive a user-created stream that is already closed
-
handleOutgoingEnded
public Http2StreamHandling.StreamState handleOutgoingEnded()
-
handleOutgoingFailed
public Http2StreamHandling.StreamState handleOutgoingFailed(java.lang.Throwable cause)
-
incomingStreamPulled
public Http2StreamHandling.StreamState incomingStreamPulled()
-
pullNextFrame
public scala.Tuple2<Http2StreamHandling.StreamState,PullFrameResult> pullNextFrame(int maxSize)
-
receivedUnexpectedFrame
public Http2StreamHandling.StreamState receivedUnexpectedFrame(FrameEvent.StreamFrameEvent e)
-
shutdown
public void shutdown()
Called to cleanup any state when the connection is torn down
-
stateName
public java.lang.String stateName()
-
-