anyNotIdle() — netty Function Reference
Architecture documentation for the anyNotIdle() function in IdleStateHandlerTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 1cc6fb30_92ac_540a_93b5_d0513d5059f6["anyNotIdle()"] f1a156c3_6366_afc7_6b64_9543e5f91ba9["IdleStateHandlerTest"] 1cc6fb30_92ac_540a_93b5_d0513d5059f6 -->|defined in| f1a156c3_6366_afc7_6b64_9543e5f91ba9 9ce36c1e_e2fb_1863_27ec_a20ca7eff6f7["testResetReader()"] 9ce36c1e_e2fb_1863_27ec_a20ca7eff6f7 -->|calls| 1cc6fb30_92ac_540a_93b5_d0513d5059f6 9df05e79_0f06_79c7_7d50_e308091775a6["testResetWriter()"] 9df05e79_0f06_79c7_7d50_e308091775a6 -->|calls| 1cc6fb30_92ac_540a_93b5_d0513d5059f6 5bb1f696_1ee0_b304_b852_579f3a91a5ba["testReaderNotIdle()"] 5bb1f696_1ee0_b304_b852_579f3a91a5ba -->|calls| 1cc6fb30_92ac_540a_93b5_d0513d5059f6 97a9191f_5aad_e60e_0845_ef3d3d3b16ba["testWriterNotIdle()"] 97a9191f_5aad_e60e_0845_ef3d3d3b16ba -->|calls| 1cc6fb30_92ac_540a_93b5_d0513d5059f6 aeca092e_f735_2f22_7a48_f255e8d4cdbc["testAllNotIdle()"] aeca092e_f735_2f22_7a48_f255e8d4cdbc -->|calls| 1cc6fb30_92ac_540a_93b5_d0513d5059f6 style 1cc6fb30_92ac_540a_93b5_d0513d5059f6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
handler/src/test/java/io/netty/handler/timeout/IdleStateHandlerTest.java lines 190–226
private static void anyNotIdle(IdleStateHandler idleStateHandler,
Action action, Object expected) throws Exception {
final List<Object> events = new ArrayList<Object>();
ChannelInboundHandlerAdapter handler = new ChannelInboundHandlerAdapter() {
@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
events.add(evt);
}
};
EmbeddedChannel channel = new EmbeddedChannel(idleStateHandler, handler);
channel.freezeTime();
try {
long delayInNanos = TimeUnit.SECONDS.toNanos(1);
channel.advanceTimeBy(delayInNanos / 2L + 1L, TimeUnit.NANOSECONDS);
action.run(channel);
// Advance the ticker by some fraction.
// There shouldn't be an IdleStateEvent getting fired because
// we've just performed an action on the channel that is meant
// to reset the idle task.
channel.advanceTimeBy(delayInNanos / 2L, TimeUnit.NANOSECONDS);
channel.runPendingTasks();
assertEquals(0, events.size());
// Advance the ticker by the full amount and it should yield
// in an IdleStateEvent.
channel.advanceTimeBy(delayInNanos, TimeUnit.NANOSECONDS);
channel.runPendingTasks();
assertEquals(1, events.size());
assertSame(expected, events.get(0));
} finally {
channel.finishAndReleaseAll();
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does anyNotIdle() do?
anyNotIdle() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/timeout/IdleStateHandlerTest.java.
Where is anyNotIdle() defined?
anyNotIdle() is defined in handler/src/test/java/io/netty/handler/timeout/IdleStateHandlerTest.java at line 190.
What calls anyNotIdle()?
anyNotIdle() is called by 5 function(s): testAllNotIdle, testReaderNotIdle, testResetReader, testResetWriter, testWriterNotIdle.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free