Home / Class/ DelayingExecutor Class — netty Architecture

DelayingExecutor Class — netty Architecture

Architecture documentation for the DelayingExecutor class in DelayingExecutor.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  16c6a296_2fed_fab2_3d61_2198b0b6feaa["DelayingExecutor"]
  ff27f9aa_fdf4_5fbc_0cc8_c7e3e35296ea["DelayingExecutor.java"]
  16c6a296_2fed_fab2_3d61_2198b0b6feaa -->|defined in| ff27f9aa_fdf4_5fbc_0cc8_c7e3e35296ea
  75e2a121_738f_065c_3c66_329f747c73c0["DelayingExecutor()"]
  16c6a296_2fed_fab2_3d61_2198b0b6feaa -->|method| 75e2a121_738f_065c_3c66_329f747c73c0
  4beaf198_f9c8_fe6a_8122_678279401677["execute()"]
  16c6a296_2fed_fab2_3d61_2198b0b6feaa -->|method| 4beaf198_f9c8_fe6a_8122_678279401677
  a5ee3426_b0fd_d1ac_65b6_c7cd4b0e2a04["shutdownAndAwaitTermination()"]
  16c6a296_2fed_fab2_3d61_2198b0b6feaa -->|method| a5ee3426_b0fd_d1ac_65b6_c7cd4b0e2a04

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/ssl/DelayingExecutor.java lines 25–48

final class DelayingExecutor implements Executor {
    private static final int CORE_POOL_SIZE = 10;
    private final ScheduledExecutorService service;

    DelayingExecutor() {
        this.service = Executors.newScheduledThreadPool(CORE_POOL_SIZE);
    }

    DelayingExecutor(ThreadFactory threadFactory) {
        this.service = Executors.newScheduledThreadPool(CORE_POOL_SIZE, threadFactory);
    }

    @Override
    public void execute(Runnable command) {
        // Let's add some jitter in terms of when the task is actual run
        service.schedule(command,
                ThreadLocalRandom.current().nextInt(100), TimeUnit.MILLISECONDS);
    }

    boolean shutdownAndAwaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
        service.shutdown();
        return service.awaitTermination(timeout, unit);
    }
}

Frequently Asked Questions

What is the DelayingExecutor class?
DelayingExecutor is a class in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/DelayingExecutor.java.
Where is DelayingExecutor defined?
DelayingExecutor is defined in handler/src/test/java/io/netty/handler/ssl/DelayingExecutor.java at line 25.

Analyze Your Own Codebase

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

Try Supermodel Free