talira

stm-chans

Bounded and closeable STM channels for Haskell

open sourceBSD-3-Clausefree

stm-chans adds channel types to stm's TChan and TQueue for Haskell: bounded FIFO channels (TBChan) whose writers block when full so they can't get too far ahead of readers, closeable FIFO channels and queues (TMChan, TMQueue), and bounded closeable versions of both. It's by wren gayle romano and Thomas DuBuisson.

Problems it solves

  • a bounded channel with backpressure in Haskell STM
  • close an STM channel to signal end of input in Haskell
  • limit memory use between producer and consumer threads in Haskell

Features

  • bounded FIFO channels (TBChan)
  • closeable channels and queues (TMChan, TMQueue)
  • bounded closeable channels and queues