@UnstableApi
public interface StreamByteDistributor
| Modifier and Type | Interface and Description |
|---|---|
static interface |
StreamByteDistributor.StreamState
该流的状态信息,指示当前可流式传输的字节数。
|
static interface |
StreamByteDistributor.Writer
执行写入已为流分配的字节的对象。
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
distribute(int maxBytes, StreamByteDistributor.Writer writer)
将最多
maxBytes给那些包含流传输字节的流,并遍历这些流以写入适当的字节。
|
void |
updateDependencyTree(int childStreamId, int parentStreamId, short weight, boolean exclusive)
显式更新依赖关系树。
|
void |
updateStreamableBytes(StreamByteDistributor.StreamState state)
当流的流传输字节已更改时调用。
|
void updateStreamableBytes(StreamByteDistributor.StreamState state)
void updateDependencyTree(int childStreamId,
int parentStreamId,
short weight,
boolean exclusive)
childStreamId - 与子流相关联的流标识符。
parentStreamId - 与父流关联的流标识符。
可能是0 ,使childStreamId和直接子连接。
weight - 用于parentStreamId相对于其他子流的parentStreamId 。
该值必须介于1和256(含)之间。
exclusive - 如果
childStreamId应该是
childStreamId的独占依赖
parentStreamId 。
boolean distribute(int maxBytes,
StreamByteDistributor.Writer writer)
throws Http2Exception
maxBytes给那些包含流传输字节的流并遍历这些流以写入适当的字节。
遍历流的标准是未定义的,并且由实现决定何时停止在给定的流。
流式字节不会通过调用此方法自动更新。 调用者通过调用updateStreamableBytes(StreamState)来指示写入之后可流式传输的字节数。
maxBytes - 要写入的最大字节数。
true是否还有尚未写入的流式字节,否则为
false 。
Http2Exception - 如果发生内部异常并且内部连接状态将被破坏。
Copyright © 2008–2018 The Netty Project. All rights reserved.