Home / Function/ run() — netty Function Reference

run() — netty Function Reference

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

Function java Buffer Telemetry calls 4 called by 1

Entity Profile

Dependency Diagram

graph TD
  5047d6fd_705b_2516_f43b_43d0d4eed8f0["run()"]
  6e8a7bbd_d782_0f59_8bd2_22f815f8ecad["ManualIoEventLoop"]
  5047d6fd_705b_2516_f43b_43d0d4eed8f0 -->|defined in| 6e8a7bbd_d782_0f59_8bd2_22f815f8ecad
  f1d6723d_11e8_2181_bfa8_0f815f8e8b73["runNow()"]
  f1d6723d_11e8_2181_bfa8_0f815f8e8b73 -->|calls| 5047d6fd_705b_2516_f43b_43d0d4eed8f0
  d8560c28_a723_319b_2fa5_b340e2554ead["isShuttingDown()"]
  5047d6fd_705b_2516_f43b_43d0d4eed8f0 -->|calls| d8560c28_a723_319b_2fa5_b340e2554ead
  e422e9d3_1ca3_619c_c230_1924aa80fc46["runAllTasksBeforeDestroy()"]
  5047d6fd_705b_2516_f43b_43d0d4eed8f0 -->|calls| e422e9d3_1ca3_619c_c230_1924aa80fc46
  71302cf5_5128_e497_27ae_5d79625b4107["runAllTasks()"]
  5047d6fd_705b_2516_f43b_43d0d4eed8f0 -->|calls| 71302cf5_5128_e497_27ae_5d79625b4107
  3e7e4a66_8309_6caf_79d2_0f675f55fea1["checkCurrentThread()"]
  5047d6fd_705b_2516_f43b_43d0d4eed8f0 -->|calls| 3e7e4a66_8309_6caf_79d2_0f675f55fea1
  style 5047d6fd_705b_2516_f43b_43d0d4eed8f0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/ManualIoEventLoop.java lines 215–242

    private int run(IoHandlerContext context, long runAllTasksTimeoutNanos) {
        if (!initialized) {
            if (owningThread.get() == null) {
                throw new IllegalStateException("Owning thread not set");
            }
            initialized = true;
            handler.initialize();
        }
        EventExecutor old = ThreadExecutorMap.setCurrentExecutor(this);
        try {
            if (isShuttingDown()) {
                if (terminationFuture.isDone()) {
                    // Already completely terminated
                    return 0;
                }
                return runAllTasksBeforeDestroy();
            }
            final int ioTasks = handler.run(context);
            // Now run all tasks.
            if (runAllTasksTimeoutNanos < 0) {
                return ioTasks;
            }
            assert runAllTasksTimeoutNanos >= 0;
            return ioTasks + runAllTasks(runAllTasksTimeoutNanos, false);
        } finally {
            ThreadExecutorMap.setCurrentExecutor(old);
        }
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does run() do?
run() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/ManualIoEventLoop.java.
Where is run() defined?
run() is defined in transport/src/main/java/io/netty/channel/ManualIoEventLoop.java at line 215.
What does run() call?
run() calls 4 function(s): checkCurrentThread, isShuttingDown, runAllTasks, runAllTasksBeforeDestroy.
What calls run()?
run() is called by 1 function(s): runNow.

Analyze Your Own Codebase

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

Try Supermodel Free