Home / Function/ runDelegatedTasks() — netty Function Reference

runDelegatedTasks() — netty Function Reference

Architecture documentation for the runDelegatedTasks() function in SslHandler.java from the netty codebase.

Function java Buffer Allocators calls 7 called by 3

Entity Profile

Dependency Diagram

graph TD
  985b3057_a9f6_8ddd_4409_70c4485507c5["runDelegatedTasks()"]
  d8b07a7c_44f8_c4e9_efe8_49bfae7d4af1["SslHandler"]
  985b3057_a9f6_8ddd_4409_70c4485507c5 -->|defined in| d8b07a7c_44f8_c4e9_efe8_49bfae7d4af1
  ca3c58ac_45a7_24e9_d74b_140cea69627e["wrap()"]
  ca3c58ac_45a7_24e9_d74b_140cea69627e -->|calls| 985b3057_a9f6_8ddd_4409_70c4485507c5
  5759ad29_b25e_dc08_15d9_5d7a84356f31["wrapNonAppData()"]
  5759ad29_b25e_dc08_15d9_5d7a84356f31 -->|calls| 985b3057_a9f6_8ddd_4409_70c4485507c5
  51b61e7d_0f6d_53c7_ed6a_56a55b2ed5a7["unwrap()"]
  51b61e7d_0f6d_53c7_ed6a_56a55b2ed5a7 -->|calls| 985b3057_a9f6_8ddd_4409_70c4485507c5
  c424fd0b_8c85_a9c8_f54b_4dd373f93722["inEventLoop()"]
  985b3057_a9f6_8ddd_4409_70c4485507c5 -->|calls| c424fd0b_8c85_a9c8_f54b_4dd373f93722
  586d9480_c5dd_d8c2_fcc9_bd16fdeca640["setState()"]
  985b3057_a9f6_8ddd_4409_70c4485507c5 -->|calls| 586d9480_c5dd_d8c2_fcc9_bd16fdeca640
  76c29ce6_0f40_5920_ac6c_9a57c7af7d1d["AsyncTaskCompletionHandler()"]
  985b3057_a9f6_8ddd_4409_70c4485507c5 -->|calls| 76c29ce6_0f40_5920_ac6c_9a57c7af7d1d
  76b17694_e400_466f_6abe_a3b69d5ddb11["resumeLater()"]
  985b3057_a9f6_8ddd_4409_70c4485507c5 -->|calls| 76b17694_e400_466f_6abe_a3b69d5ddb11
  5fccc820_4d5c_02e0_7572_31b2a69fd790["clearState()"]
  985b3057_a9f6_8ddd_4409_70c4485507c5 -->|calls| 5fccc820_4d5c_02e0_7572_31b2a69fd790
  d5c0dc3b_c9c6_3584_a1bf_3d5d471c5803["executeDelegatedTask()"]
  985b3057_a9f6_8ddd_4409_70c4485507c5 -->|calls| d5c0dc3b_c9c6_3584_a1bf_3d5d471c5803
  f0428da0_54a3_9dcb_eefb_1da6c347f719["run()"]
  985b3057_a9f6_8ddd_4409_70c4485507c5 -->|calls| f0428da0_54a3_9dcb_eefb_1da6c347f719
  style 985b3057_a9f6_8ddd_4409_70c4485507c5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/ssl/SslHandler.java lines 1681–1721

    private boolean runDelegatedTasks(boolean inUnwrap) {
        if (delegatedTaskExecutor == ImmediateExecutor.INSTANCE || inEventLoop(delegatedTaskExecutor)) {
            // We should run the task directly in the EventExecutor thread and not offload at all. As we are on the
            // EventLoop we can just run all tasks at once.
            for (;;) {
                Runnable task = engine.getDelegatedTask();
                if (task == null) {
                    return true;
                }
                setState(STATE_PROCESS_TASK);
                if (task instanceof AsyncRunnable) {
                    // Let's set the task to processing task before we try to execute it.
                    boolean pending = false;
                    try {
                        AsyncRunnable asyncTask = (AsyncRunnable) task;
                        AsyncTaskCompletionHandler completionHandler = new AsyncTaskCompletionHandler(inUnwrap);
                        asyncTask.run(completionHandler);
                        pending = completionHandler.resumeLater();
                        if (pending) {
                            return false;
                        }
                    } finally {
                        if (!pending) {
                            // The task has completed, lets clear the state. If it is not completed we will clear the
                            // state once it is.
                            clearState(STATE_PROCESS_TASK);
                        }
                    }
                } else {
                    try {
                        task.run();
                    } finally {
                        clearState(STATE_PROCESS_TASK);
                    }
                }
            }
        } else {
            executeDelegatedTask(inUnwrap);
            return false;
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does runDelegatedTasks() do?
runDelegatedTasks() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/ssl/SslHandler.java.
Where is runDelegatedTasks() defined?
runDelegatedTasks() is defined in handler/src/main/java/io/netty/handler/ssl/SslHandler.java at line 1681.
What does runDelegatedTasks() call?
runDelegatedTasks() calls 7 function(s): AsyncTaskCompletionHandler, clearState, executeDelegatedTask, inEventLoop, resumeLater, run, setState.
What calls runDelegatedTasks()?
runDelegatedTasks() is called by 3 function(s): unwrap, wrap, wrapNonAppData.

Analyze Your Own Codebase

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

Try Supermodel Free