Implementing the Reactor Pattern - Part 1
Explore the implementation of the Reactor pattern in C by understanding its core components including the EventHandler interface, OS handles, and the Reactor's role in event demultiplexing. Learn how to register concrete event handlers and apply design principles for efficient event-driven applications.
We'll cover the following...
We'll cover the following...
The Reactor pattern
The intent of the Reactor pattern is: “The Reactor architectural pattern allows event-driven applications to demultiplex and dispatch service requests that are delivered to an application from one or more clients” (Schmidt et al).
The roles of the involved participants are:
- EventHandler: An EventHandler defines an interface to be implemented by modules reacting to events. Each EventHandler owns its Handle.
- Handle: An efficient implementation of the Reactor pattern requires an OS that supports handles (examples of Handles include system resources like files, sockets, and timers).
- DiagnosticsServer and