-- 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.0.0

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 <a>Manager</a>
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.
withManager :: Int -> (Manager -> IO a) -> IO a

-- | Registering a timeout action.
register :: Manager -> TimeoutAction -> IO Handle

-- | Registering a timeout action of killing this thread.
registerKillThread :: Manager -> TimeoutAction -> IO Handle

-- | Setting the state to active. <a>Manager</a> turns active to inactive
--   repeatedly.
tickle :: Handle -> IO ()

-- | Setting the state to canceled. <a>Manager</a> eventually removes this
--   without timeout action.
cancel :: Handle -> IO ()

-- | Setting the state to paused. <a>Manager</a> does not change the value.
pause :: Handle -> IO ()

-- | Setting the paused state to active. This is an alias to <a>tickle</a>.
resume :: Handle -> IO ()
data TimeoutThread
TimeoutThread :: TimeoutThread
instance GHC.Exception.Type.Exception System.TimeManager.TimeoutThread
instance GHC.Show.Show System.TimeManager.TimeoutThread
