Skip to content

Netty EventLoopGroup Hierarchy

The Netty EventLoopGroup Hierarchy defines the inheritance and structure of the core concurrency components in Netty, primarily centering on the EventLoopGroup and EventExecutor interfaces and their various implementations.

Class Structure

The hierarchy organizes execution and event handling logic into several key branches^[600-developer__big-data__netty__netty-EventLoopGroup.md]:

  • NioEventLoopGroup: The standard implementation for NIO-based transport.
    • Extends MultithreadEventLoopGroup.
    • Related to DefaultEventLoopGroup.
  • EventExecutor: The base for executing tasks.
    • SingleThreadEventExecutor: Abstract class for tasks executed by a single thread.
    • SingleThreadEventLoop: Extends the executor to handle event loops.
    • EmbeddedEventLoop: A non-network IO loop implementation, typically used for testing or embedding.
  • RejectedExecutionHandlers: Components that determine behavior when task submission fails.
  • DefaultPromise: The concrete implementation of asynchronous results.

Interface Relationships

A key distinction in the hierarchy involves the inheritance of the Group interfaces^[600-developer__big-data__netty__netty-EventLoopGroup.md]:

  • EventLoopGroup extends EventExecutorGroup.
  • MultithreadEventLoopGroup extends MultithreadEventExecutorGroup.

This separation allows EventLoopGroup to specialize in channel registration and I/O event processing while inheriting the general task execution capabilities from the executor group hierarchy.

Foundation

The concurrency model relies on the standard Java java.util.concurrent.Executor interface^[600-developer__big-data__netty__netty-EventLoopGroup.md]. This Functional Interface allows for decoupling of task submission from execution mechanics. Netty's hierarchy adapts this standard interface to support its specific requirements for asynchronous network I/O.

  • [[Reactive Programming]]
  • [[Concurrency Model]]
  • [[Java Executor]]

Sources

^[600-developer__big-data__netty__netty-EventLoopGroup.md]