Maintains a single interval, which is used to trigger tasks.
This is useful for something like:
- sending heartbeat messages
- performing cleanup operations occasionally
Set the interval lenght for the heartbeat.
Start or resume the heartbeat.
Change the trigger time of the next timeout. For example, in order to guarantee that first heartbeat occurs within a shorter amount of time than average.
Add a callback to the heartbeat actions.
Remove a callback from the heartbeat actions.
Pause the heartbeat.
Clear the heartbeat and all callback actions.