Example usage for io.netty.handler.codec.http2 Http2RemoteFlowController isWritable

List of usage examples for io.netty.handler.codec.http2 Http2RemoteFlowController isWritable

Introduction

In this page you can find the example usage for io.netty.handler.codec.http2 Http2RemoteFlowController isWritable.

Prototype

boolean isWritable(Http2Stream stream);

Source Link

Document

Determine if the stream has bytes remaining for use in the flow control window.

Usage

From source file:io.vertx.core.http.impl.VertxHttp2ConnectionHandler.java

License:Open Source License

private void _writeData(Http2Stream stream, ByteBuf chunk, boolean end) {
    encoder().writeData(ctx, stream.id(), chunk, 0, end, ctx.newPromise());
    Http2RemoteFlowController controller = encoder().flowController();
    if (!controller.isWritable(stream) || end) {
        try {//from   w ww  . ja va  2s .  co m
            encoder().flowController().writePendingBytes();
        } catch (Http2Exception e) {
            onError(ctx, e);
        }
    }
    ctx.channel().flush();
}