Reactor pattern
The reactor design pattern is a concurrent programming pattern for handling service requests delivered concurrently to a service handler by one or more inputs. The service handler then demultiplexes the incoming requests and dispatches them synchronously to the associated request handlers.
* Resources: Any resource that can provide input or output to the system.
* Synchronous Event Demultiplexer: Uses an event loop to block on all resources. When it is possible to start a synchronous operation on a resource without blocking, the demultiplexer sends the resource to the dispatcher.
* Dispatcher: Handles registering and unregistering of request handlers. Dispatches resources from the demultiplexer to the associated request handler.
* Request Handler: An application defined request handler and its associated resource.
http://www.cs.wustl.edu/~schmidt/PDF/reactor-siemens.pdf
沒有留言:
張貼留言