Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Maintianer : ongy Stability : experimental
This implementation lacks support for anything but IOInput and IOOutput!.
The main appeal of this is, that it runs in the Haskell RTS system and does not
block the RTS in any way.
If the doLoop
function is called in an forkIO
, all functions will "just work",
and may be wrapped into a synchronous api wrapper.
If the callback style application flow should be used, this will dispatch all callbacks in the same (Haskell)-thread.
Most function *should* be thread safe (adding multiple events etc.) but there are no checks done for incompatible things happening (modifying and removing the same event).
- data MainloopImpl
- getMainloopImpl :: IO MainloopImpl
- doIteration :: MainloopImpl -> IO ()
- doLoop :: MainloopImpl -> IO Int
Documentation
data MainloopImpl Source #
Implementation type, keeping state about existing events.
PAMainloop MainloopImpl Source # | |
data PAIOEvent MainloopImpl Source # | |
data PATimeEvent MainloopImpl Source # | |
data PADeferEvent MainloopImpl Source # | |
getMainloopImpl :: IO MainloopImpl Source #
Create a new MainloopImpl
with initial state
doIteration :: MainloopImpl -> IO () Source #
Do one iteration of events. This may be dispatchin defered events, a timer, an io event, or simply a wakeup. Event callback will be called in the same thread as this!