Safe Haskell | None |
---|
Contains a simple source and sink linking together conduits in
different threads. For extended examples of usage and bottlenecks
see TMChan
.
TQueue is an amoritized FIFO queue behaves like TChan, with two important differences:
- it's faster (but amortized thus the cost of individual operations may vary a lot)
- it doesn't provide equivalent of the dupTChan and cloneTChan operations
Here is short description of data structures:
- TQueue - unbounded infinite queue * TBQueue - bounded infinite queue * TMQueue - unbounded finite (closable) queue * TBMQueue - bounded finite (closable) queue
Caveats
Infinite operations means that source doesn't know when stream is ended so one need to use other methods of finishing stream like sending an exception or finish conduit in downstream.
- sourceTQueue :: MonadIO m => TQueue a -> Source m a
- sinkTQueue :: MonadIO m => TQueue a -> Sink a m ()
- sourceTBQueue :: MonadIO m => TBQueue a -> Source m a
- sinkTBQueue :: MonadIO m => TBQueue a -> Sink a m ()
- sourceTMQueue :: MonadIO m => TMQueue a -> Source m a
- sinkTMQueue :: MonadIO m => TMQueue a -> Sink a m ()
- sourceTBMQueue :: MonadIO m => TBMQueue a -> Source m a
- sinkTBMQueue :: MonadIO m => TBMQueue a -> Sink a m ()
- module Control.Concurrent.STM.TQueue
Connectors
TQueue connectors
sourceTQueue :: MonadIO m => TQueue a -> Source m aSource
sinkTQueue :: MonadIO m => TQueue a -> Sink a m ()Source
TBQueue connectors
sourceTBQueue :: MonadIO m => TBQueue a -> Source m aSource
sinkTBQueue :: MonadIO m => TBQueue a -> Sink a m ()Source
TMQueue connectors
sourceTMQueue :: MonadIO m => TMQueue a -> Source m aSource
sinkTMQueue :: MonadIO m => TMQueue a -> Sink a m ()Source
TBMQueue connectors
sourceTBMQueue :: MonadIO m => TBMQueue a -> Source m aSource
sinkTBMQueue :: MonadIO m => TBMQueue a -> Sink a m ()Source