closeAfterFinishEncode() — netty Function Reference
Architecture documentation for the closeAfterFinishEncode() function in EncoderUtil.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD ae24e180_ee6e_f254_7a0c_1c5992d5e25c["closeAfterFinishEncode()"] 5499d506_cee0_224f_e7be_e0b040cb5803["EncoderUtil"] ae24e180_ee6e_f254_7a0c_1c5992d5e25c -->|defined in| 5499d506_cee0_224f_e7be_e0b040cb5803 style ae24e180_ee6e_f254_7a0c_1c5992d5e25c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-compression/src/main/java/io/netty/handler/codec/compression/EncoderUtil.java lines 28–49
static void closeAfterFinishEncode(final ChannelHandlerContext ctx, final ChannelFuture finishFuture,
final ChannelPromise promise) {
if (!finishFuture.isDone()) {
// Ensure the channel is closed even if the write operation completes in time.
final Future<?> future = ctx.executor().schedule(new Runnable() {
@Override
public void run() {
ctx.close(promise);
}
}, THREAD_POOL_DELAY_SECONDS, TimeUnit.SECONDS);
finishFuture.addListener(f -> {
// Cancel the scheduled timeout.
future.cancel(true);
if (!promise.isDone()) {
ctx.close(promise);
}
});
} else {
ctx.close(promise);
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does closeAfterFinishEncode() do?
closeAfterFinishEncode() is a function in the netty codebase, defined in codec-compression/src/main/java/io/netty/handler/codec/compression/EncoderUtil.java.
Where is closeAfterFinishEncode() defined?
closeAfterFinishEncode() is defined in codec-compression/src/main/java/io/netty/handler/codec/compression/EncoderUtil.java at line 28.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free