data EventManager Source
The event manager state.
CreationCreate a new event manager.
getSystemEventManager :: IO (Maybe EventManager)Source
Retrieve the system event manager.
This function always returns Just
the system event manager when using the threaded RTS and Nothing
otherwise.
loop :: EventManager -> IO ()Source
Start handling events. This function loops until told to stop, using shutdown
.
Note: This loop can only be run once per EventManager
, as it closes all of its control resources when it finishes.
step :: EventManager -> TimeoutQueue -> IO (Bool, TimeoutQueue)Source
shutdown :: EventManager -> IO ()Source
Asynchronously shuts down the event manager, if running.
Registering interest in I/O eventsAn I/O event.
Instances
Eq Event Show Event Monoid EventData is available to be read.
The file descriptor is ready to accept a write.
type IOCallback = FdKey -> Event -> IO ()Source
Callback invoked on I/O events.
A file descriptor registration cookie.
Instances
Eq FdKey Show FdKeyregisterFd :: EventManager -> IOCallback -> Fd -> Event -> IO FdKeySource
registerFd mgr cb fd evs
registers interest in the events evs
on the file descriptor fd
. cb
is called for each event that occurs. Returns a cookie that can be handed to unregisterFd
.
registerFd_ :: EventManager -> IOCallback -> Fd -> Event -> IO (FdKey, Bool)Source
Register interest in the given events, without waking the event manager thread. The Bool
return value indicates whether the event manager ought to be woken.
unregisterFd :: EventManager -> FdKey -> IO ()Source
Drop a previous file descriptor registration.
unregisterFd_ :: EventManager -> FdKey -> IO BoolSource
Drop a previous file descriptor registration, without waking the event manager thread. The return value indicates whether the event manager ought to be woken.
closeFd :: EventManager -> (Fd -> IO ()) -> Fd -> IO ()Source
Close a file descriptor in a race-safe way.
Registering interest in timeout eventstype TimeoutCallback = IO ()Source
Callback invoked on timeout events.
data TimeoutKey Source
A timeout registration cookie.
Instances
Eq TimeoutKeyregisterTimeout :: EventManager -> Int -> TimeoutCallback -> IO TimeoutKeySource
Register a timeout in the given number of microseconds. The returned TimeoutKey
can be used to later unregister or update the timeout. The timeout is automatically unregistered after the given time has passed.
updateTimeout :: EventManager -> TimeoutKey -> Int -> IO ()Source
Update an active timeout to fire in the given number of microseconds.
unregisterTimeout :: EventManager -> TimeoutKey -> IO ()Source
Unregister an active timeout.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4