Skip to main content

Reactor

ConcurrencyPerformanceReactiveLess than 1 minute

Intent

The Reactor design pattern handles service requests that are delivered concurrently to an application by one or more clients. The application can register specific handlers for processing which are called by reactor on specific events. Dispatching of event handlers is performed by an initiation dispatcher, which manages the registered event handlers. Demultiplexing of service requests is performed by a synchronous event demultiplexer.

Class diagram

Reactor
Reactor

Applicability

Use Reactor pattern when

  • A server application needs to handle concurrent service requests from multiple clients.
  • A server application needs to be available for receiving requests from new clients even when handling older client requests.
  • A server must maximize throughput, minimize latency and use CPU efficiently without blocking.

Credits