distributed-process-0.7.5: Cloud Haskell: Erlang-style concurrency in Haskell
Safe HaskellNone
LanguageHaskell2010

Control.Distributed.Process.Internal.CQueue

Description

Concurrent queue for single reader, single writer

Synopsis

Documentation

data CQueue a Source #

data MatchOn m a Source #

Constructors

MatchMsg (m -> Maybe a) 
MatchChan (STM a) 

Instances

Instances details
Functor (MatchOn m) Source # 
Instance details

Defined in Control.Distributed.Process.Internal.CQueue

Methods

fmap :: (a -> b) -> MatchOn m a -> MatchOn m b #

(<$) :: a -> MatchOn m b -> MatchOn m a #

enqueue :: CQueue a -> a -> IO () Source #

Enqueue an element

Enqueue is strict.

enqueueSTM :: CQueue a -> a -> STM () Source #

Variant of enqueue for use in the STM monad.

dequeue Source #

Arguments

:: CQueue m

Queue

-> BlockSpec

Blocking behaviour

-> [MatchOn m a]

List of matches

-> IO (Maybe a)

Nothing only on timeout

Dequeue an element

The timeout (if any) is applied only to waiting for incoming messages, not to checking messages that have already arrived

mkWeakCQueue :: CQueue a -> IO () -> IO (Weak (CQueue a)) Source #

Weak reference to a CQueue