|
Erebot
latest
A modular IRC bot for PHP 5.3+
|
Interface for a timer implementation. More...
Inheritance diagram for Erebot\TimerInterface:Public Member Functions | |
| activate () | |
| getArgs () | |
| getCallback () | |
| getDelay () | |
| getRepetition () | |
| getStream () | |
| reset () | |
| setArgs (array $args) | |
| setCallback (\Erebot\CallableInterface $callback) | |
| setRepetition ($repeat) | |
Interface for a timer implementation.
This interface provides the necessary methods to implement timers and make them available to other parts of the bot.
Definition at line 31 of file TimerInterface.php.
| Erebot\TimerInterface::activate | ( | ) |
Calls the callback.
Implemented in Erebot\Timer.
| Erebot\TimerInterface::getArgs | ( | ) |
Returns an array of additional arguments to pass to the callback.
| array | Arguments that will be passed to the callback. |
Implemented in Erebot\Timer.
| Erebot\TimerInterface::getCallback | ( | ) |
Returns a reference to the callback associated with this timer.
| callback | The callback for this timer. |
Implemented in Erebot\Timer.
| Erebot\TimerInterface::getDelay | ( | ) |
Returns the delay after which the callback will be called. This is the original value given to the timer during construction, and it is not updated live as time passes by.
| number | The original delay for this timer, as decided at construction time. |
Implemented in Erebot\Timer.
| Erebot\TimerInterface::getRepetition | ( | ) |
Returns the number of timer this timer will be restarted.
| int | Returns the repetition state of the timer. |
Implemented in Erebot\Timer.
| Erebot\TimerInterface::getStream | ( | ) |
Returns the underlying stream used by the implementation to create timers.
| stream | The underlying PHP stream. |
Implemented in Erebot\Timer.
| Erebot\TimerInterface::reset | ( | ) |
(Re)starts the timer.
Implemented in Erebot\Timer.
| Erebot\TimerInterface::setArgs | ( | array | $args | ) |
Sets the arguments for this timer.
Whenever this timer fires, its callback will be called with these arguments.
| array | $args | An array containing the parameters to pass to this timer's callback whenever it fires. The parameters will be passed in the same order they appear in this array. |
Implemented in Erebot\Timer.
| Erebot\TimerInterface::setCallback | ( | \Erebot\CallableInterface | $callback | ) |
Sets the callback associated with this timer.
| Erebot::CallableInterface | $callback | This callable object will be called whenever the timer fires. |
Implemented in Erebot\Timer.
| Erebot\TimerInterface::setRepetition | ( | $repeat | ) |
Changes the number of times this timer can go off.
| bool | int | $repeat | Can be either:
|
Implemented in Erebot\Timer.