equeue-0: Application level triggered, and edge triggered event multiqueues.

Safe HaskellSafe
LanguageHaskell2010

Control.Concurrent.EQueue.STMEQueue

Description

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.

Synopsis

Documentation

data STMEQueue a Source #

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.

Constructors

STMEQueue 
Instances
EQueueW STMEQueue Source # 
Instance details

Defined in Control.Concurrent.EQueue.STMEQueue

Associated Types

type WaitPolicy STMEQueue :: Type Source #

Methods

waitEQ :: MonadIO m => STMEQueue a -> WaitPolicy STMEQueue -> m [a] Source #

EQueue STMEQueue Source # 
Instance details

Defined in Control.Concurrent.EQueue.STMEQueue

Methods

registerSemi :: (MonadIO m, Semigroup b) => STMEQueue a -> (b -> a) -> m (b -> IO (), IO ()) Source #

registerQueued :: MonadIO m => STMEQueue a -> m (a -> IO (), IO ()) Source #

type WaitPolicy STMEQueue Source # 
Instance details

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.

Constructors

ReturnImmediate

Immediately return, even if no events are available.

RequireEvent

Wait for at least one event to be available before returning.