Safe Haskell | None |
---|---|
Language | Haskell2010 |
System.TimeManager
Synopsis
- type Manager = Reaper [Handle] Handle
- type TimeoutAction = IO ()
- data Handle
- initialize :: Int -> IO Manager
- stopManager :: Manager -> IO ()
- killManager :: Manager -> IO ()
- withManager :: Int -> (Manager -> IO a) -> IO a
- withManager' :: Int -> (Manager -> IO a) -> IO a
- register :: Manager -> TimeoutAction -> IO Handle
- registerKillThread :: Manager -> TimeoutAction -> IO Handle
- tickle :: Handle -> IO ()
- cancel :: Handle -> IO ()
- pause :: Handle -> IO ()
- resume :: Handle -> IO ()
- data TimeoutThread = TimeoutThread
Types
type TimeoutAction = IO () #
An action to be performed on timeout.
Manager
initialize :: Int -> IO Manager #
Creating timeout manager which works every N micro seconds where N is the first argument.
stopManager :: Manager -> IO () #
Stopping timeout manager with onTimeout fired.
killManager :: Manager -> IO () #
Killing timeout manager immediately without firing onTimeout.
Call the inner function with a timeout manager.
stopManager
is used after that.
Call the inner function with a timeout manager.
killManager
is used after that.
Registration
registerKillThread :: Manager -> TimeoutAction -> IO Handle #
Registering a timeout action of killing this thread.
Control
Setting the state to active.
Manager
turns active to inactive repeatedly.
Setting the state to canceled.
Manager
eventually removes this without timeout action.
Exceptions
data TimeoutThread #
Constructors
TimeoutThread |
Instances
Exception TimeoutThread # | |
Defined in System.TimeManager Methods toException :: TimeoutThread -> SomeException # fromException :: SomeException -> Maybe TimeoutThread # displayException :: TimeoutThread -> String # | |
Show TimeoutThread # | |
Defined in System.TimeManager Methods showsPrec :: Int -> TimeoutThread -> ShowS # show :: TimeoutThread -> String # showList :: [TimeoutThread] -> ShowS # |