Reactor pattern¶
The Reactor pattern is a design pattern for demultiplexing and dispatching service requests delivered concurrently to a service handler from one or more clients, commonly used in concurrent programming and networked applications.^[600-developer-big-data-netty-netty-reactor.md]
Overview¶
The pattern defines an architecture where a single reactor (or dispatcher) waits for events to occur on multiple sources, such as network sockets. When an event occurs, the reactor demultiplexes the event and dispatches it to the appropriate handler, allowing the system to handle multiple concurrent I/O operations efficiently without requiring a multi-threaded context for every connection.^[600-developer__big-data__netty__netty-Reactor.md]
Key Components¶
- Handles: Identifies resources like network sockets.
- Event Demultiplexer: Waits for events on handles (e.g.,
select()). - Dispatcher: Handles event detection and routing.
- Event Handler: Defines the interface for processing specific events.
Related Concepts¶
- [[Netty]]
- [[NIO]]
- [[Proactor]]
Sources¶
600-developer__big-data__netty__netty-Reactor.md