iteratee-stm-0.1.2: Concurrent iteratees using STM

Safe HaskellSafe-Infered

Data.Iteratee.STM

Contents

Synopsis

Channel enumerator/iteratee primitives

iterChan :: (Nullable s, MonadIO m) => TBMChan s -> Iteratee s m ()Source

An iteratee which writes all its data to a TBMChan.

The iteratee moves to a complete state when the channel is closed.

enumChan :: (NullPoint s, MonadIO m) => TBMChan s -> Enumerator s m aSource

Enumerate over data provided by a TBMChan.

Channel control functions

iterCloseChan :: (Nullable s, MonadIO m) => TBMChan s -> Iteratee s m ()Source

Close a channel.

enumCloseChan :: MonadIO m => TBMChan s -> Enumerator s m aSource

An enumerator which closes the provided channel and sends EOF to the iteratee.

Forking combinators

forkIter :: (Nullable s, NullPoint s, MonadIO m) => Int -> Iteratee s IO () -> Iteratee s m ()Source

Fork an iteratee to run in a separate thread, with a sz upper bound on the channel size.

The current thread will wait for the forked thread to finish before returning.

forkEnum :: (MonadIO m, Nullable s, NullPoint s) => Int -> Enumerator s IO () -> Enumerator s m aSource

Fork an enumerator to run in a separate thread, with a sz upper bound on the channel size.

The current thread will wait for the forked thread to terminate