3.1 The Reaction Timer API

The methods used for managing timer events are provided by the standard reactor interface (Reactor), as defined in the API package. The full set of methods used for timer management are shown in Listing 3.1.


\begin{listing}
% latex2html id marker 606\begin{small}\begin{verbatim}packa...
...nd{verbatim} \end{small}\caption{Reactor Timer Management Methods}
\end{listing}


\begin{listing}
% latex2html id marker 614\begin{small}\begin{verbatim}packa...
...d{verbatim} \end{small}\caption{The Timeable Interface Definition}
\end{listing}

The three timer API methods provide support for issuing a single timed callback (runTimerOneShot), issuing multiple timed callbacks at regular intervals (runTimerRepeating) and cancelling a running timer (cancelTimer). In each case a single timeable object which provides the Timeable interface is passed as a parameter. This is the timeable object to which the callbacks will be issued and is also used as a timer `ID' when cancelling or rescheduling a timer. The use of these various API methods is described in more detail in the following sections.