Home / Function/ execute() — netty Function Reference

execute() — netty Function Reference

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

Function java Buffer Search calls 3 called by 2

Entity Profile

Dependency Diagram

graph TD
  729fd7e8_e86c_368b_bd97_0d4948bc5a92["execute()"]
  6e8a7bbd_d782_0f59_8bd2_22f815f8ecad["ManualIoEventLoop"]
  729fd7e8_e86c_368b_bd97_0d4948bc5a92 -->|defined in| 6e8a7bbd_d782_0f59_8bd2_22f815f8ecad
  1ea01bfe_aff7_1fed_ded7_0caadc201a25["register()"]
  1ea01bfe_aff7_1fed_ded7_0caadc201a25 -->|calls| 729fd7e8_e86c_368b_bd97_0d4948bc5a92
  eb3c0e75_ca52_c8d2_04c6_92c2e500b077["confirmShutdown()"]
  eb3c0e75_ca52_c8d2_04c6_92c2e500b077 -->|calls| 729fd7e8_e86c_368b_bd97_0d4948bc5a92
  cb229a6f_1187_05e7_0073_c0b824cf6ff7["inEventLoop()"]
  729fd7e8_e86c_368b_bd97_0d4948bc5a92 -->|calls| cb229a6f_1187_05e7_0073_c0b824cf6ff7
  48223eea_986c_3d1d_e693_09a9f5ad5d05["isShutdown()"]
  729fd7e8_e86c_368b_bd97_0d4948bc5a92 -->|calls| 48223eea_986c_3d1d_e693_09a9f5ad5d05
  5c67a711_94d8_0c2e_2269_2064aba35491["wakeup()"]
  729fd7e8_e86c_368b_bd97_0d4948bc5a92 -->|calls| 5c67a711_94d8_0c2e_2269_2064aba35491
  style 729fd7e8_e86c_368b_bd97_0d4948bc5a92 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/ManualIoEventLoop.java lines 525–553

    @Override
    public final void execute(Runnable command) {
        Objects.requireNonNull(command, "command");
        boolean inEventLoop = inEventLoop();
        if (inEventLoop) {
            if (isShutdown()) {
                throw new RejectedExecutionException("event executor terminated");
            }
        }
        taskQueue.add(command);
        if (!inEventLoop) {
            if (isShutdown()) {
                boolean reject = false;
                try {
                    if (taskQueue.remove(command)) {
                        reject = true;
                    }
                } catch (UnsupportedOperationException e) {
                    // The task queue does not support removal so the best thing we can do is to just move on and
                    // hope we will be able to pick-up the task before its completely terminated.
                    // In worst case we will log on termination.
                }
                if (reject) {
                    throw new RejectedExecutionException("event executor terminated");
                }
            }
            handler.wakeup();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does execute() do?
execute() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/ManualIoEventLoop.java.
Where is execute() defined?
execute() is defined in transport/src/main/java/io/netty/channel/ManualIoEventLoop.java at line 525.
What does execute() call?
execute() calls 3 function(s): inEventLoop, isShutdown, wakeup.
What calls execute()?
execute() is called by 2 function(s): confirmShutdown, register.

Analyze Your Own Codebase

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

Try Supermodel Free