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

Safe HaskellSafe
LanguageHaskell2010

Control.Concurrent.EQueue.Class

Description

This module provides the core abstractions that represent managers for queueable events.

Synopsis

Documentation

class EQueue eq where Source #

An EQueue is a way of managing edge and level triggered events. The choice of EQueue implementation allows late binding of the policy by which the application processes events.

Methods

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

Registers a level triggered event. These are the events that accumulate a combined change or resulting state. Returns a function to enqueue updates and unregister this event.

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

Registers an edge triggered event. Returns a function to enqueue updates and unregister this event.

Instances
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 #

EQueue ForceEdge Source # 
Instance details

Defined in Control.Concurrent.EQueue

Methods

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

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

EQueue AnyEQueue Source # 
Instance details

Defined in Control.Concurrent.EQueue

Methods

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

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

EQueue IOEQueue Source # 
Instance details

Defined in Control.Concurrent.EQueue.Simple

Methods

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

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

EQueue TQueueEQueue Source #

Can not unregister events

Instance details

Defined in Control.Concurrent.EQueue.Simple

Methods

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

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

EQueue TChanEQueue Source #

Can not unregister events

Instance details

Defined in Control.Concurrent.EQueue.Simple

Methods

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

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

EQueue ChanEQueue Source #

Can not unregister events

Instance details

Defined in Control.Concurrent.EQueue.Simple

Methods

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

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

EQueue eq => EQueue (MappedEQueue eq b) Source # 
Instance details

Defined in Control.Concurrent.EQueue

Methods

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

registerQueued :: MonadIO m => MappedEQueue eq b a -> m (a -> IO (), IO ()) Source #

class EQueueW eq where Source #

An EQueueW is the interface for waiting on events in a queue.

Associated Types

type WaitPolicy eq :: * Source #

The WaitPolicy allows control per-call of waitEQ as to which policy is followed. For example, if it should return immediately if there are no events to dequeue or if it should wait for at least one event to be available.

Methods

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

The dequeue operation, collecting some set of available events, depending on the particular policy the given EQueue impliments.

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 #

EQueueW TQueueEQueue Source # 
Instance details

Defined in Control.Concurrent.EQueue.Simple

Associated Types

type WaitPolicy TQueueEQueue :: Type Source #

EQueueW TChanEQueue Source # 
Instance details

Defined in Control.Concurrent.EQueue.Simple

Associated Types

type WaitPolicy TChanEQueue :: Type Source #

Methods

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

EQueueW ChanEQueue Source # 
Instance details

Defined in Control.Concurrent.EQueue.Simple

Associated Types

type WaitPolicy ChanEQueue :: Type Source #

Methods

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