Loading...
Searching...
No Matches
Reactor.h File Reference

An implementation of Reactor pattern. More...

`#include <sys/time.h>`
`#include <map>`
`#include <sys/resource.h>`
`#include "assa/EventHandler.h"`
`#include "assa/Singleton.h"`
`#include "assa/MaskSet.h"`
`#include "assa/TimerQueue.h"`
`#include "assa/TimerCountdown.h"`

Go to the source code of this file.

## Classes

class | ASSA::Reactor

## Namespaces

namespace | ASSA

## Detailed Description

An implementation of Reactor pattern.

This class takes after Reactor pattern described in "An Object Behavioral Pattern for Demultiplexing and Dispatching Handles for Synchronous Events" by D.C. Schmidt.

Design of it is highly influenced by ACE's own implementation of Reactor class as well as by InterViews V 3.1 from Stanford University.

Reactor reads data from a file descriptor, writes data to a file descriptor, handles an I/O exception on a file descriptor, or handles a timer's expiration. Once the user has requested the Reactor to attach EventHandler to a file descriptor or a timer, Reactor will automatically notify the EventHandler when the file descriptor's I/O condition changes to the timer expires.

Most of the time, however, event processing is shared with some other event processor, such as X event loop routine of Gtk+ or another communication framework such as CORBA. In this case, timed event loop is used. This can be achieved by calling Reactor::waitForEvents (TimeVal* tv_).

Definition in file Reactor.h.