distributed-process-0.7.0: Cloud Haskell: Erlang-style concurrency in Haskell

Safe HaskellNone
LanguageHaskell98

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

Functor (MatchOn m) Source # 

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