Home / Function/ run() — netty Function Reference

run() — netty Function Reference

Architecture documentation for the run() function in AutoScalingEventExecutorChooserFactoryTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  7381030b_fad1_d2e6_14a3_4852bdaf698c["run()"]
  621041f0_4644_9edd_5867_6d66d195dcf5["TestEventExecutor"]
  7381030b_fad1_d2e6_14a3_4852bdaf698c -->|defined in| 621041f0_4644_9edd_5867_6d66d195dcf5
  c5a0b3a7_c8b4_5eef_b007_12c15fd9bf15["busyTask()"]
  7381030b_fad1_d2e6_14a3_4852bdaf698c -->|calls| c5a0b3a7_c8b4_5eef_b007_12c15fd9bf15
  style 7381030b_fad1_d2e6_14a3_4852bdaf698c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/test/java/io/netty/util/concurrent/AutoScalingEventExecutorChooserFactoryTest.java lines 54–87

        @Override
        protected void run() {
            do {
                if (highLoad.get()) {
                    runAllTasks(TimeUnit.MILLISECONDS.toNanos(20));
                    long busyWorkStart = ticker().nanoTime();
                    busyTask(35, TimeUnit.MILLISECONDS);
                    long busyWorkEnd = ticker().nanoTime();
                    reportActiveIoTime(busyWorkEnd - busyWorkStart);
                    try {
                        Thread.sleep(10);
                    } catch (InterruptedException e) {
                        Thread.currentThread().interrupt();
                        break;
                    }
                } else {
                    boolean ranTask = runAllTasks();
                    if (ranTask) {
                        updateLastExecutionTime();
                        // If we ran tasks, immediately loop back to check highLoad state
                        continue;
                    }

                    // No immediate tasks available, sleep to avoid busy waiting
                    // This allows the thread to be responsive to state changes while staying idle
                    try {
                        Thread.sleep(50);
                    } catch (InterruptedException e) {
                        Thread.currentThread().interrupt();
                        break;
                    }
                }
            } while (!confirmShutdown() && !canSuspend());
        }

Domain

Subdomains

Calls

Frequently Asked Questions

What does run() do?
run() is a function in the netty codebase, defined in common/src/test/java/io/netty/util/concurrent/AutoScalingEventExecutorChooserFactoryTest.java.
Where is run() defined?
run() is defined in common/src/test/java/io/netty/util/concurrent/AutoScalingEventExecutorChooserFactoryTest.java at line 54.
What does run() call?
run() calls 1 function(s): busyTask.

Analyze Your Own Codebase

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

Try Supermodel Free