Package akka.http.impl.engine.http2
Interface Http2StreamHandling
-
- All Superinterfaces:
akka.macros.LogHelper
,akka.macros.LogHelperMacro
public interface Http2StreamHandling extends akka.macros.LogHelper
INTERNAL APIHandles HTTP/2 stream states Accepts
FrameEvent
s from the network side and emitsByteHttp2SubStream
s for streams to be handled by the Akka HTTP layer.Mixed into the Http2ServerDemux graph logic.
-
-
Nested Class Summary
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
activeStreamCount()
Http2StreamHandling.Closed$
Closed()
Accessor for nested Scala objectvoid
dispatchSubstream(FrameEvent.ParsedHeadersFrame initialHeaders, scala.util.Either<akka.util.ByteString,akka.stream.scaladsl.Source<java.lang.Object,java.lang.Object>> data, scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> correlationAttributes)
void
distributeWindowDeltaToAllStreams(int delta)
Called by multiplexer to distribute changes from INITIAL_WINDOW_SIZE to all streamsvoid
enqueueOutStream(int streamId)
IncomingFlowController
flowController()
void
handleOutgoingCreated(Http2SubStream stream)
Called by Http2ServerDemux when a stream comes in from the user-handlervoid
handleOutgoingEnded(int streamId)
void
handleOutgoingFailed(int streamId, java.lang.Throwable cause)
void
handleStreamEvent(FrameEvent.StreamFrameEvent e)
Called by Http2ServerDemux to let the state machine handle StreamFrameEventsboolean
hasCapacityToCreateStreams()
Http2StreamHandling.Idle$
Idle()
Accessor for nested Scala objectvoid
incomingStreamPulled(int streamId)
Entry-point to handle IncomingStreamBuffer.onPull through the state machineboolean
isServer()
boolean
isUpgraded()
int
lastStreamId()
The "last peer-initiated stream that was or might be processed on the sending endpoint in this connection"Http2Multiplexer
multiplexer()
void
onAllStreamsClosed()
Called when all streams in StreamHandling buffers are closed and the stage is completing.Http2StreamHandling.OutStream$
OutStream()
Accessor for nested Scala objectPullFrameResult
pullNextFrame(int streamId, int maxSize)
Called by the multiplexer if ready to send a data framevoid
pushGOAWAY(Http2Protocol.ErrorCode errorCode, java.lang.String debug)
void
resetStream(int streamId, Http2Protocol.ErrorCode errorCode)
void
setMaxConcurrentStreams(int newValue)
Http2CommonSettings
settings()
void
shutdownStreamHandling()
Called to cleanup any state when the connection is torn downHttp2StreamHandling.StreamState
streamFor(int streamId)
void
tryPullSubStreams()
Tries to generate demand of SubStreams on the inlet from the user handler.void
updateAllStates(scala.Function1<Http2StreamHandling.StreamState,Http2StreamHandling.StreamState> handle, java.lang.String event, java.lang.Object eventArg)
void
updateState(int streamId, scala.Function1<Http2StreamHandling.StreamState,Http2StreamHandling.StreamState> handle, java.lang.String event, java.lang.Object eventArg)
<R> R
updateStateAndReturn(int streamId, scala.Function1<Http2StreamHandling.StreamState,scala.Tuple2<Http2StreamHandling.StreamState,R>> handle, java.lang.String event, java.lang.Object eventArg)
scala.Option<HttpEntity.ChunkStreamPart>
wrapTrailingHeaders(FrameEvent.ParsedHeadersFrame headers)
-
-
-
Method Detail
-
Idle
Http2StreamHandling.Idle$ Idle()
Accessor for nested Scala object- Returns:
- (undocumented)
-
Closed
Http2StreamHandling.Closed$ Closed()
Accessor for nested Scala object- Returns:
- (undocumented)
-
OutStream
Http2StreamHandling.OutStream$ OutStream()
Accessor for nested Scala object- Returns:
- (undocumented)
-
isServer
boolean isServer()
-
multiplexer
Http2Multiplexer multiplexer()
-
settings
Http2CommonSettings settings()
-
pushGOAWAY
void pushGOAWAY(Http2Protocol.ErrorCode errorCode, java.lang.String debug)
-
dispatchSubstream
void dispatchSubstream(FrameEvent.ParsedHeadersFrame initialHeaders, scala.util.Either<akka.util.ByteString,akka.stream.scaladsl.Source<java.lang.Object,java.lang.Object>> data, scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> correlationAttributes)
-
isUpgraded
boolean isUpgraded()
-
wrapTrailingHeaders
scala.Option<HttpEntity.ChunkStreamPart> wrapTrailingHeaders(FrameEvent.ParsedHeadersFrame headers)
-
flowController
IncomingFlowController flowController()
-
tryPullSubStreams
void tryPullSubStreams()
Tries to generate demand of SubStreams on the inlet from the user handler. The attemp to demand will succeed if the inlet is open and has no pending pull, and, in the case of a client, if we're not exceedingthe number of active streams. This method must be invoked any time the collection of active streams or the value of maxConcurrentStreams are modified but the invocation must happen _after_ the collection or the limit are modified.
-
lastStreamId
int lastStreamId()
The "last peer-initiated stream that was or might be processed on the sending endpoint in this connection"- Returns:
- (undocumented)
-
setMaxConcurrentStreams
void setMaxConcurrentStreams(int newValue)
-
hasCapacityToCreateStreams
boolean hasCapacityToCreateStreams()
- Returns:
- true if the number of outgoing Active streams (Active includes Open and any variant of HalfClosedXxx) doesn't exceed MaxConcurrentStreams
-
onAllStreamsClosed
void onAllStreamsClosed()
Called when all streams in StreamHandling buffers are closed and the stage is completing.
-
streamFor
Http2StreamHandling.StreamState streamFor(int streamId)
-
activeStreamCount
int activeStreamCount()
-
handleStreamEvent
void handleStreamEvent(FrameEvent.StreamFrameEvent e)
Called by Http2ServerDemux to let the state machine handle StreamFrameEvents
-
handleOutgoingCreated
void handleOutgoingCreated(Http2SubStream stream)
Called by Http2ServerDemux when a stream comes in from the user-handler
-
handleOutgoingEnded
void handleOutgoingEnded(int streamId)
-
handleOutgoingFailed
void handleOutgoingFailed(int streamId, java.lang.Throwable cause)
-
distributeWindowDeltaToAllStreams
void distributeWindowDeltaToAllStreams(int delta)
Called by multiplexer to distribute changes from INITIAL_WINDOW_SIZE to all streams
-
pullNextFrame
PullFrameResult pullNextFrame(int streamId, int maxSize)
Called by the multiplexer if ready to send a data frame
-
incomingStreamPulled
void incomingStreamPulled(int streamId)
Entry-point to handle IncomingStreamBuffer.onPull through the state machine
-
updateAllStates
void updateAllStates(scala.Function1<Http2StreamHandling.StreamState,Http2StreamHandling.StreamState> handle, java.lang.String event, java.lang.Object eventArg)
-
updateState
void updateState(int streamId, scala.Function1<Http2StreamHandling.StreamState,Http2StreamHandling.StreamState> handle, java.lang.String event, java.lang.Object eventArg)
-
enqueueOutStream
void enqueueOutStream(int streamId)
-
updateStateAndReturn
<R> R updateStateAndReturn(int streamId, scala.Function1<Http2StreamHandling.StreamState,scala.Tuple2<Http2StreamHandling.StreamState,R>> handle, java.lang.String event, java.lang.Object eventArg)
-
shutdownStreamHandling
void shutdownStreamHandling()
Called to cleanup any state when the connection is torn down
-
resetStream
void resetStream(int streamId, Http2Protocol.ErrorCode errorCode)
-
-