libraft-0.5.0.0: Raft consensus algorithm

Safe HaskellSafe
LanguageHaskell2010

Control.Concurrent.STM.Timer

Synopsis

Documentation

newTimer :: Natural -> IO Timer Source #

Create a new timer with the supplied timer action and timer length,

newTimerRange :: Int -> (Natural, Natural) -> IO Timer Source #

Create a new timer with the supplied timer action, random seed, and range from which the the timer will choose a random timer length at each start or reset.

startTimer :: Timer -> IO Bool Source #

Start the timer. If the timer is already running, the timer is not started. Returns True if the timer was succesfully started.

resetTimer :: Timer -> IO () Source #

Resets the timer with a new random timeout.

waitTimer :: Timer -> IO () Source #

Wait for a timer to complete