write-buffer-stm-0.1.0.0: A write buffer for STM channels and queues.

Safe HaskellNone
LanguageHaskell2010

WriteBuffer.STM.TBMQueue

Synopsis

Documentation

writeBufferTBMQueue Source #

Arguments

:: Int

The output queue bound

-> Int

The chunk size for the output lists.

-> Integer

The amount of time to wait in microseconds.

-> TBMQueue a

The input queue.

-> IO (TBMQueue [a]) 

This function takes a TBMQueue a and yields a new TBMQueue [a] which yields lists of the original inputs. The first parameter is the bound of the output queue size -- the threads will block if this size is reached and nothing is drawing from it. The second parameter is the chunk size -- at most, this many elements will be in each output list. The third parameter is the maximum amount of time to wait before yielding a list.