Reactor: an object behavioral pattern for concurrent event demultiplexing and event handler dispatching

To illustrate the Reactor pattern, consider the event-driven server for a distributed logging service shown in Figure 1. Client applications use this service to log information (such as error notifications, debugging traces, and status updates) in a distributed environment. In this service, logging records are sent to a central logging server. The logging server outputs the logging records to a console, a printer, a file, or a network management database, etc. In the architecture of the distributed logging service, the logging server shown in Figure 1 handles logging records and connection requests sent by clients. These records and requests may arrive concurrently on multiple I/O handles. An I/O handle identifies a resource control block managed by the operating system.1 The logging server listens on one I/O handle for connection requests to arrive from new clients. In addition, a separate I/O handle is associated with each connected client. Input from multiple clients may arrive concurrently. Therefore,