Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
This module provides an EQueue implimentation that uses STM to wait on the first available event among a set of possible events. When Waited on it can provide up to one event from every available event source when it provides one event, allowing coalescing.
Documentation
A basic example implimentation of an EQueue using STM. This implimentation must look at every registered event source leading to inefficiency in systems with a very large number of sources. For most systems it should be a sufficient implimentation though.
Instances
EQueueW STMEQueue Source # | |
Defined in Control.Concurrent.EQueue.STMEQueue type WaitPolicy STMEQueue :: Type Source # | |
EQueue STMEQueue Source # | |
type WaitPolicy STMEQueue Source # | |
Defined in Control.Concurrent.EQueue.STMEQueue |
register :: MonadIO m => STMEQueue a -> STM (Maybe a) -> m (IO ()) Source #
Passed an STM dequeueing the current value of this signal. Returns an action to unregister said.
newSTMEQueue :: MonadIO m => m (STMEQueue a) Source #
Create a new STMEQueue which initally has no event sources registered.
data STMEQueueWait Source #
The policy for waiting on an STMEQueue.
ReturnImmediate | Immediately return, even if no events are available. |
RequireEvent | Wait for at least one event to be available before returning. |
Instances
Eq STMEQueueWait Source # | |
Defined in Control.Concurrent.EQueue.STMEQueue (==) :: STMEQueueWait -> STMEQueueWait -> Bool # (/=) :: STMEQueueWait -> STMEQueueWait -> Bool # |