Home / Function/ runScheduledAndExecutorTasks() — netty Function Reference

runScheduledAndExecutorTasks() — netty Function Reference

Architecture documentation for the runScheduledAndExecutorTasks() function in SingleThreadEventExecutor.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  5a39e93d_3c59_adfe_8e2c_fcd0d6bdeea5["runScheduledAndExecutorTasks()"]
  c9189467_acbc_07ea_3a8c_fecfe22ec122["SingleThreadEventExecutor"]
  5a39e93d_3c59_adfe_8e2c_fcd0d6bdeea5 -->|defined in| c9189467_acbc_07ea_3a8c_fecfe22ec122
  957fd634_92d8_ad7a_8d3f_c6d9e5d7ee2a["inEventLoop()"]
  5a39e93d_3c59_adfe_8e2c_fcd0d6bdeea5 -->|calls| 957fd634_92d8_ad7a_8d3f_c6d9e5d7ee2a
  5459d7ae_bd4e_27c5_fc92_8a5ebd983141["runExistingTasksFrom()"]
  5a39e93d_3c59_adfe_8e2c_fcd0d6bdeea5 -->|calls| 5459d7ae_bd4e_27c5_fc92_8a5ebd983141
  ca91acb1_82cd_2370_4ca6_61b2353753d6["executeExpiredScheduledTasks()"]
  5a39e93d_3c59_adfe_8e2c_fcd0d6bdeea5 -->|calls| ca91acb1_82cd_2370_4ca6_61b2353753d6
  74baded2_7ae5_b964_9529_61a1e7a6c626["afterRunningAllTasks()"]
  5a39e93d_3c59_adfe_8e2c_fcd0d6bdeea5 -->|calls| 74baded2_7ae5_b964_9529_61a1e7a6c626
  style 5a39e93d_3c59_adfe_8e2c_fcd0d6bdeea5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/main/java/io/netty/util/concurrent/SingleThreadEventExecutor.java lines 457–473

    protected final boolean runScheduledAndExecutorTasks(final int maxDrainAttempts) {
        assert inEventLoop();
        boolean ranAtLeastOneTask;
        int drainAttempt = 0;
        do {
            // We must run the taskQueue tasks first, because the scheduled tasks from outside the EventLoop are queued
            // here because the taskQueue is thread safe and the scheduledTaskQueue is not thread safe.
            ranAtLeastOneTask = runExistingTasksFrom(taskQueue) | executeExpiredScheduledTasks();
        } while (ranAtLeastOneTask && ++drainAttempt < maxDrainAttempts);

        if (drainAttempt > 0) {
            lastExecutionTime = getCurrentTimeNanos();
        }
        afterRunningAllTasks();

        return drainAttempt > 0;
    }

Domain

Subdomains

Frequently Asked Questions

What does runScheduledAndExecutorTasks() do?
runScheduledAndExecutorTasks() is a function in the netty codebase, defined in common/src/main/java/io/netty/util/concurrent/SingleThreadEventExecutor.java.
Where is runScheduledAndExecutorTasks() defined?
runScheduledAndExecutorTasks() is defined in common/src/main/java/io/netty/util/concurrent/SingleThreadEventExecutor.java at line 457.
What does runScheduledAndExecutorTasks() call?
runScheduledAndExecutorTasks() calls 4 function(s): afterRunningAllTasks, executeExpiredScheduledTasks, inEventLoop, runExistingTasksFrom.

Analyze Your Own Codebase

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

Try Supermodel Free