io.netty.channel.ChannelProgressivePromise Java Examples

The following examples show how to use io.netty.channel.ChannelProgressivePromise. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ChunkedWriteHandler.java    From netty-4.1.22 with Apache License 2.0 5 votes vote down vote up
void success(long total) {
    if (promise.isDone()) {
        // No need to notify the progress or fulfill the promise because it's done already.不需要通知进度或履行承诺,因为它已经完成了。
        return;
    }

    if (promise instanceof ChannelProgressivePromise) {
        // Now we know what the total is.
        ((ChannelProgressivePromise) promise).tryProgress(total, total);
    }

    promise.trySuccess();
}
 
Example #2
Source File: ChunkedWriteHandler.java    From netty4.0.27Learn with Apache License 2.0 5 votes vote down vote up
void success() {
    if (promise.isDone()) {
        // No need to notify the progress or fulfill the promise because it's done already.
        return;
    }

    if (promise instanceof ChannelProgressivePromise) {
        // Now we know what the total is.
        ((ChannelProgressivePromise) promise).tryProgress(progress, progress);
    }

    promise.trySuccess();
}
 
Example #3
Source File: DelegatingChannelHandlerContext.java    From aws-sdk-java-v2 with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {
    return delegate.newProgressivePromise();
}
 
Example #4
Source File: DelayableWriteChannel.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {
    return delegate.newProgressivePromise();
}
 
Example #5
Source File: MockChannelHandlerContext.java    From karyon with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {
    return new DefaultChannelProgressivePromise(channel);
}
 
Example #6
Source File: NettyResponseChannelTest.java    From ambry with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {
  return new DefaultChannelProgressivePromise(embeddedChannel);
}
 
Example #7
Source File: ChannelAdapter.java    From onos with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {
    return null;
}
 
Example #8
Source File: ChannelHandlerContextAdapter.java    From onos with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {
    return null;
}
 
Example #9
Source File: ChannelAdapter.java    From onos with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {
    return null;
}
 
Example #10
Source File: ChannelHandlerContextAdapter.java    From onos with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {
    return null;
}
 
Example #11
Source File: ChannelAdapter.java    From onos with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {
    return null;
}
 
Example #12
Source File: ChannelHandlerContextAdapter.java    From onos with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {

    return null;
}
 
Example #13
Source File: AbstractRequestContextBuilder.java    From armeria with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {
    throw new UnsupportedOperationException();
}
 
Example #14
Source File: ChunkedWriteHandler.java    From netty4.0.27Learn with Apache License 2.0 4 votes vote down vote up
void progress(int amount) {
    progress += amount;
    if (promise instanceof ChannelProgressivePromise) {
        ((ChannelProgressivePromise) promise).tryProgress(progress, -1);
    }
}
 
Example #15
Source File: CaptureChannelHandlerContext.java    From timely with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {
    return null;
}
 
Example #16
Source File: MockChannelHandlerContext.java    From sofa-registry with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {
    return null;
}
 
Example #17
Source File: CaptureChannelHandlerContext.java    From qonduit with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {
    return null;
}
 
Example #18
Source File: PooledDirectByteBufAllocator.java    From cantor with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {
    return ctx.newProgressivePromise();
}
 
Example #19
Source File: ServletOutputStreamWrapper.java    From spring-boot-protocol with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise write(File file, long position, long count) throws IOException {
    return source.write(file,position,count);
}
 
Example #20
Source File: ServletOutputStreamWrapper.java    From spring-boot-protocol with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise write(FileChannel fileChannel, long position, long count) throws IOException {
    return source.write(fileChannel,position,count);
}
 
Example #21
Source File: ServletOutputStreamWrapper.java    From spring-boot-protocol with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise write(ChunkedInput input) throws IOException {
    return source.write(input);
}
 
Example #22
Source File: ByteToMessageDecoder.java    From servicetalk with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {
    assert delegate != null;
    return delegate.newProgressivePromise();
}
 
Example #23
Source File: Http2MultiplexCodec.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
@Override
public ChannelProgressivePromise newProgressivePromise() {
    return pipeline().newProgressivePromise();
}
 
Example #24
Source File: EmbeddedChannelHandlerContext.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
@Override
public final ChannelProgressivePromise newProgressivePromise() {
    return channel().newProgressivePromise();
}
 
Example #25
Source File: NettyOutputStream.java    From spring-boot-protocol with Apache License 2.0 2 votes vote down vote up
/**
 * use netty zero copy
 * @param file file
 * @param count count
 * @param position position
 * @return ChannelProgressivePromise {@link ChannelProgressivePromise#addListener(GenericFutureListener)} }
 * @see GenericProgressiveFutureListener
 * @throws IOException if close
 */
ChannelProgressivePromise write(File file, long position, long count) throws IOException;
 
Example #26
Source File: NettyOutputStream.java    From spring-boot-protocol with Apache License 2.0 2 votes vote down vote up
/**
 * use netty zero copy
 * @param fileChannel FileChannel
 * @param count count
 * @param position position
 * @return ChannelProgressivePromise {@link ChannelProgressivePromise#addListener(GenericFutureListener)} }
 * @see GenericProgressiveFutureListener
 * @throws IOException if close
 */
ChannelProgressivePromise write(FileChannel fileChannel, long position, long count) throws IOException;
 
Example #27
Source File: NettyOutputStream.java    From spring-boot-protocol with Apache License 2.0 2 votes vote down vote up
/**
 * use netty batch write
 * @param input ChunkedInput
 * @see ChunkedFile
 * @see ChunkedNioStream
 * @see ChunkedNioFile
 * @see ChunkedStream
 * @return ChannelProgressivePromise
 * @throws IOException if close
 */
ChannelProgressivePromise write(ChunkedInput input) throws IOException;