The Reactor design pattern is an ArchitecturalPattern that allows event-driven applications to demultiplex and dispatch service requestst that are delivered to an application from one or more clients.
A.K.A. Dispatcher, Notifier
Context An event-driven application receives multiple service requests simultaneously, but processes them synchronously and serially.
Example: In file mode, West Wind Web Connection implements a Reactor pattern. Essentially the Web hit causes wc.dll to create a file wherein the details of the hit are placed. A timer on the Server object reacts (and is hence a reactor) and reads the file, creating and firing a process object which processes the web hit. The return trip is simply the same process in reverse, with the return text being written to a file which wc.dll (the reactor) reads, erases, and forwards to the web server.
Read more in Pattern Oriented Software Architecture Volume 2 which unfortunately goes deep into implementation-specific details of their example.
Category Design Patterns
( Topic last updated: 2001.02.11 02:29:02 PM )