distributed-process-0.5.3: 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) 

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

:: forall m a . 
=> 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