BlockingIoHandlerContext Class — netty Architecture
Architecture documentation for the BlockingIoHandlerContext class in ManualIoEventLoop.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 495e052d_514b_eec5_cd6e_30fd871a39f6["BlockingIoHandlerContext"] 5b394ac8_3e72_9e94_7d05_d43c1bc35e4d["ManualIoEventLoop.java"] 495e052d_514b_eec5_cd6e_30fd871a39f6 -->|defined in| 5b394ac8_3e72_9e94_7d05_d43c1bc35e4d 695bcc65_4fd4_b6ea_9dd3_441ad1bac7cf["canBlock()"] 495e052d_514b_eec5_cd6e_30fd871a39f6 -->|method| 695bcc65_4fd4_b6ea_9dd3_441ad1bac7cf 165d6b7a_0daa_5fe3_4789_c978ff23967a["delayNanos()"] 495e052d_514b_eec5_cd6e_30fd871a39f6 -->|method| 165d6b7a_0daa_5fe3_4789_c978ff23967a d5fe8552_21be_76db_be8c_06f4a94dc962["deadlineNanos()"] 495e052d_514b_eec5_cd6e_30fd871a39f6 -->|method| d5fe8552_21be_76db_be8c_06f4a94dc962
Relationship Graph
Source Code
transport/src/main/java/io/netty/channel/ManualIoEventLoop.java lines 649–680
private class BlockingIoHandlerContext implements IoHandlerContext {
// this is a positive amount of nanos or Long.MAX_VALUE for no limit
long maxBlockingNanos = Long.MAX_VALUE;
@Override
public boolean canBlock() {
assert inEventLoop();
return !hasTasks() && !hasScheduledTasks() && ManualIoEventLoop.this.canBlock();
}
@Override
public long delayNanos(long currentTimeNanos) {
assert inEventLoop();
return Math.min(maxBlockingNanos, ManualIoEventLoop.this.delayNanos(currentTimeNanos, maxBlockingNanos));
}
@Override
public long deadlineNanos() {
assert inEventLoop();
long next = nextScheduledTaskDeadlineNanos();
if (maxBlockingNanos == Long.MAX_VALUE) {
// next == -1? -1 : next i.e. return next
return next;
}
long now = ticker.nanoTime();
// we cannot just check Math.min as nanoTime can be negative or wrap around!
if (next == -1 || next - now > maxBlockingNanos) {
return now + maxBlockingNanos;
}
return next;
}
}
Source
Frequently Asked Questions
What is the BlockingIoHandlerContext class?
BlockingIoHandlerContext is a class in the netty codebase, defined in transport/src/main/java/io/netty/channel/ManualIoEventLoop.java.
Where is BlockingIoHandlerContext defined?
BlockingIoHandlerContext is defined in transport/src/main/java/io/netty/channel/ManualIoEventLoop.java at line 649.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free