The event manager state.
Modulebase-4.20.2.0Haskell2010
GHC.Event
This module provides scalable event notification for file descriptors and timeouts.
This module should be considered GHC internal.
---------------------------------------------------------------------------
- 8 types
- 13 values
- Packagebase-4.20.2.0
- Exports21
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceEvent.hs
Types
2 declarationsThe event manager state.
Creation
3 declarationsCreate a new event manager.
Registering interest in I/O events
11 declarationsAn I/O event.
Instances4Eq, Show, Semigroup, Monoid
Eq EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesShow EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesSemigroup EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesMonoid EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.Types
Data is available to be read.
The file descriptor is ready to accept a write.
Callback invoked on I/O events.
A file descriptor registration cookie.
The lifetime of an event registration.
Instances4Eq, Show, Semigroup, Monoid
Eq LifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesShow LifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesSemigroup LifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesMonoid LifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.Typesmappendtakes the longer of two lifetimes.
registerFd mgr cb fd evs lt registers interest in the events evs
on the file descriptor fd for lifetime lt. cb is called for
each event that occurs. Returns a cookie that can be handed to
unregisterFd.
Drop a previous file descriptor registration.
Drop a previous file descriptor registration, without waking the event manager thread. The return value indicates whether the event manager ought to be woken.
Close a file descriptor in a race-safe way. It might block, although for a very short time; and thus it is interruptible by asynchronous exceptions.
Registering interest in timeout events
5 declarationsWarning: since the TimeoutCallback is called from the I/O manager, it must not throw an exception or block for a long period of time. In particular, be wary of throwTo and killThread: if the target thread is making a foreign call, these functions will block until the call completes.
A timeout registration cookie.
Instances2Eq, Ord
Eq TimeoutKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.TimeOutOrd TimeoutKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.TimeOut
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.
Be careful not to exceed maxBound :: Int, which on 32-bit machines is only
2147483647 μs, less than 36 minutes.
Update an active timeout to fire in the given number of microseconds.
Be careful not to exceed maxBound :: Int, which on 32-bit machines is only
2147483647 μs, less than 36 minutes.
Unregister an active timeout.