Low level interface to Linux' epoll, a high performance polling mechanism which handles high numbers of file descriptors efficiently. See man epoll(7) for details.
- data EventType
- data Size
- toSize :: Int -> Maybe Size
- data Duration
- toDuration :: Int -> Maybe Duration
- data Descriptor a
- data Device
- data Event a
- (=~) :: EventType -> EventType -> Bool
- create :: Size -> IO Device
- close :: Device -> IO ()
- wait :: Duration -> Device -> IO [Event a]
- add :: Device -> a -> [EventType] -> Fd -> IO (Descriptor a)
- modify :: Device -> [EventType] -> Descriptor a -> IO ()
- delete :: Device -> Descriptor a -> IO ()
- freeDesc :: Descriptor a -> IO ()
- inEvent :: EventType
- outEvent :: EventType
- peerCloseEvent :: EventType
- urgentEvent :: EventType
- errorEvent :: EventType
- hangupEvent :: EventType
- edgeTriggeredEvent :: EventType
- oneShotEvent :: EventType
- combineEvents :: [EventType] -> EventType
EventType corresponds to epoll's event type defines, e.g. EPOLLIN, EPOLLOUT, EPOLLET, etc.
Unsigned type used for timeout specifications.
Waits for the specified duration on all event descriptors. Returns the list of events that occured.
Adds a filedescriptor to the epoll watch set using the specified
EventTypes. User data might be passed in as well which will be returned on
event occurence as part of the
Event type. Returns an event descriptor
which must be deleted from the watch set with
delete and passed to
freeDesc exactly once.
Modified the event types of the event descriptor.
Removes the event descriptor from the epoll watch set. and frees descriptor which must not be used afterwards.
Frees the resources associated with this descriptor. Must be called exactly once.