Module io.netty.codec.http2
Package io.netty5.handler.codec.http2
Interface Http2RemoteFlowController
-
- All Superinterfaces:
Http2FlowController
- All Known Implementing Classes:
DefaultHttp2RemoteFlowController
@UnstableApi public interface Http2RemoteFlowController extends Http2FlowController
AHttp2FlowControllerfor controlling the flow of outboundDATAframes to the remote endpoint.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceHttp2RemoteFlowController.FlowControlledImplementations of this interface are used to progressively write chunks of the underlying payload to the stream.static interfaceHttp2RemoteFlowController.ListenerListener to the number of flow-controlled bytes written per stream.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddFlowControlled(Http2Stream stream, Http2RemoteFlowController.FlowControlled payload)Queues a payload for transmission to the remote endpoint.ChannelHandlerContextchannelHandlerContext()Get theChannelHandlerContextfor which to apply flow control on.voidchannelWritabilityChanged()Notification that the writability ofchannelHandlerContext()has changed.booleanhasFlowControlled(Http2Stream stream)Determine ifstreamhas anyHttp2RemoteFlowController.FlowControlledframes currently queued.booleanisWritable(Http2Stream stream)Determine if thestreamhas bytes remaining for use in the flow control window.voidlistener(Http2RemoteFlowController.Listener listener)Set the active listener on the flow-controller.voidupdateDependencyTree(int childStreamId, int parentStreamId, short weight, boolean exclusive)Explicitly update the dependency tree.voidwritePendingBytes()Write all data pending in the flow controller up to the flow-control limits.-
Methods inherited from interface io.netty5.handler.codec.http2.Http2FlowController
channelHandlerContext, incrementWindowSize, initialWindowSize, initialWindowSize, windowSize
-
-
-
-
Method Detail
-
channelHandlerContext
ChannelHandlerContext channelHandlerContext()
Get theChannelHandlerContextfor which to apply flow control on.This is intended for us by
Http2RemoteFlowController.FlowControlledimplementations only. Use with caution.- Returns:
- The
ChannelHandlerContextfor which to apply flow control on.
-
addFlowControlled
void addFlowControlled(Http2Stream stream, Http2RemoteFlowController.FlowControlled payload)
Queues a payload for transmission to the remote endpoint. There is no guarantee as to when the data will be written or how it will be assigned to frames. before sending.Writes do not actually occur until
writePendingBytes()is called.- Parameters:
stream- the subject stream. Must not be the connection stream object.payload- payload to write subject to flow-control accounting and ordering rules.
-
hasFlowControlled
boolean hasFlowControlled(Http2Stream stream)
Determine ifstreamhas anyHttp2RemoteFlowController.FlowControlledframes currently queued.- Parameters:
stream- the stream to check if it has flow controlled frames.- Returns:
trueifstreamhas anyHttp2RemoteFlowController.FlowControlledframes currently queued.
-
writePendingBytes
void writePendingBytes() throws Http2ExceptionWrite all data pending in the flow controller up to the flow-control limits.- Throws:
Http2Exception- throws if a protocol-related error occurred.
-
listener
void listener(Http2RemoteFlowController.Listener listener)
Set the active listener on the flow-controller.- Parameters:
listener- to notify when the a write occurs, can benull.
-
isWritable
boolean isWritable(Http2Stream stream)
Determine if thestreamhas bytes remaining for use in the flow control window.Note that this method respects channel writability. The channel must be writable for this method to return
true.- Parameters:
stream- The stream to test.- Returns:
trueif thestreamhas bytes remaining for use in the flow control window and the channel is writable,falseotherwise.
-
channelWritabilityChanged
void channelWritabilityChanged() throws Http2ExceptionNotification that the writability ofchannelHandlerContext()has changed.- Throws:
Http2Exception- If any writes occur as a result of this call and encounter errors.
-
updateDependencyTree
void updateDependencyTree(int childStreamId, int parentStreamId, short weight, boolean exclusive)Explicitly update the dependency tree. This method is called independently of stream state changes.- Parameters:
childStreamId- The stream identifier associated with the child stream.parentStreamId- The stream identifier associated with the parent stream. May be0, to makechildStreamIdand immediate child of the connection.weight- The weight which is used relative to other child streams forparentStreamId. This value must be between 1 and 256 (inclusive).exclusive- IfchildStreamIdshould be the exclusive dependency ofparentStreamId.
-
-