Home / Function/ testTasksWhileExpiringTimeout() — netty Function Reference

testTasksWhileExpiringTimeout() — netty Function Reference

Architecture documentation for the testTasksWhileExpiringTimeout() function in ManualIoEventLoopTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  d695e87b_5829_1e7d_d14b_152461120fe9["testTasksWhileExpiringTimeout()"]
  7f1091cc_a8b6_0293_92ad_d94222ae6482["ManualIoEventLoopTest"]
  d695e87b_5829_1e7d_d14b_152461120fe9 -->|defined in| 7f1091cc_a8b6_0293_92ad_d94222ae6482
  style d695e87b_5829_1e7d_d14b_152461120fe9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/ManualIoEventLoopTest.java lines 301–327

    @ParameterizedTest
    @EnumSource(RunMode.class)
    public void testTasksWhileExpiringTimeout(RunMode mode) {
        MockTicker ticker = Ticker.newMockTicker();
        ManualIoEventLoop eventLoop = new ManualIoEventLoop(
                null, Thread.currentThread(), LocalIoHandler.newFactory(), ticker);
        AtomicBoolean executedFirst = new AtomicBoolean(false);
        eventLoop.execute(() -> {
            assertTrue(executedFirst.compareAndSet(false, true));
            ticker.advance(1, TimeUnit.NANOSECONDS);
        });
        AtomicBoolean canExecute = new AtomicBoolean(false);
        AtomicBoolean executedSecond = new AtomicBoolean(false);
        eventLoop.execute(() -> {
            if (!canExecute.get()) {
                fail("Should not be executed");
            } else {
                assertTrue(executedSecond.compareAndSet(false, true));
            }
        });
        assertEquals(1, mode.runWith(eventLoop, 1));
        assertTrue(executedFirst.get());
        assertFalse(executedSecond.get());
        canExecute.set(true);
        assertEquals(1, mode.runWith(eventLoop, 1));
        eventLoop.shutdownGracefully();
    }

Domain

Subdomains

Frequently Asked Questions

What does testTasksWhileExpiringTimeout() do?
testTasksWhileExpiringTimeout() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/ManualIoEventLoopTest.java.
Where is testTasksWhileExpiringTimeout() defined?
testTasksWhileExpiringTimeout() is defined in transport/src/test/java/io/netty/channel/ManualIoEventLoopTest.java at line 301.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free