Home / Function/ start() — netty Function Reference

start() — netty Function Reference

Architecture documentation for the start() function in HashedWheelTimer.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  e9d21410_9c1d_0eec_d368_c04bdb308bdb["start()"]
  0a75019c_ba28_3729_1e96_e0724c6ddc24["HashedWheelTimer"]
  e9d21410_9c1d_0eec_d368_c04bdb308bdb -->|defined in| 0a75019c_ba28_3729_1e96_e0724c6ddc24
  7215ccab_c52a_80a7_3797_88ce5715a703["Timeout()"]
  7215ccab_c52a_80a7_3797_88ce5715a703 -->|calls| e9d21410_9c1d_0eec_d368_c04bdb308bdb
  ea613877_8294_fd85_27b0_0c4903842ef1["run()"]
  ea613877_8294_fd85_27b0_0c4903842ef1 -->|calls| e9d21410_9c1d_0eec_d368_c04bdb308bdb
  style e9d21410_9c1d_0eec_d368_c04bdb308bdb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/main/java/io/netty/util/HashedWheelTimer.java lines 352–376

    public void start() {
        int state = WORKER_STATE_UPDATER.get(this);
        switch (state) {
            case WORKER_STATE_INIT:
                if (WORKER_STATE_UPDATER.compareAndSet(this, WORKER_STATE_INIT, WORKER_STATE_STARTED)) {
                    workerThread.start();
                }
                break;
            case WORKER_STATE_STARTED:
                break;
            case WORKER_STATE_SHUTDOWN:
                throw new IllegalStateException("cannot be started once stopped");
            default:
                throw new Error("Invalid WorkerState: " + state);
        }

        // Wait until the startTime is initialized by the worker.
        while (startTime == 0) {
            try {
                startTimeInitialized.await();
            } catch (InterruptedException ignore) {
                // Ignore - it will be ready very soon.
            }
        }
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does start() do?
start() is a function in the netty codebase, defined in common/src/main/java/io/netty/util/HashedWheelTimer.java.
Where is start() defined?
start() is defined in common/src/main/java/io/netty/util/HashedWheelTimer.java at line 352.
What calls start()?
start() is called by 2 function(s): Timeout, run.

Analyze Your Own Codebase

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

Try Supermodel Free