-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Scalable timer -- -- Scalable timer functions provided by a timer manager. @package time-manager @version 0.1.3 module System.TimeManager -- | A timeout manager type Manager = Reaper [Handle] Handle -- | An action to be performed on timeout. type TimeoutAction = IO () -- | A handle used by Manager data Handle -- | Creating timeout manager which works every N micro seconds where N is -- the first argument. initialize :: Int -> IO Manager -- | Stopping timeout manager with onTimeout fired. stopManager :: Manager -> IO () -- | Killing timeout manager immediately without firing onTimeout. killManager :: Manager -> IO () -- | Call the inner function with a timeout manager. stopManager is -- used after that. withManager :: Int -> (Manager -> IO a) -> IO a -- | Call the inner function with a timeout manager. killManager is -- used after that. withManager' :: Int -> (Manager -> IO a) -> IO a -- | Registering a timeout action and unregister its handle when the body -- action is finished. withHandle :: Manager -> TimeoutAction -> (Handle -> IO a) -> IO a -- | Registering a timeout action of killing this thread and unregister its -- handle when the body action is killed or finished. withHandleKillThread :: Manager -> TimeoutAction -> (Handle -> IO ()) -> IO () -- | Setting the state to active. Manager turns active to inactive -- repeatedly. tickle :: Handle -> IO () -- | Setting the state to paused. Manager does not change the value. pause :: Handle -> IO () -- | Setting the paused state to active. This is an alias to tickle. resume :: Handle -> IO () -- | Registering a timeout action. register :: Manager -> TimeoutAction -> IO Handle -- | Registering a timeout action of killing this thread. -- TimeoutThread is thrown to the thread which called this -- function on timeout. Catch TimeoutThread if you don't want to -- leak the asynchronous exception to GHC RTS. registerKillThread :: Manager -> TimeoutAction -> IO Handle -- | Removing the Handle from the Manager immediately. cancel :: Handle -> IO () -- | The asynchronous exception thrown if a thread is registered via -- registerKillThread. data TimeoutThread TimeoutThread :: TimeoutThread instance GHC.Exception.Type.Exception System.TimeManager.TimeoutThread instance GHC.Show.Show System.TimeManager.TimeoutThread