chp-1.5.1: An implementation of concurrency ideas from Communicating Sequential ProcessesSource codeContentsIndex
Control.Concurrent.CHP.Buffers
Description
Various processes that act like buffers. Poisoning either end of a buffer process is immediately passed on to the other side, in contrast to C++CSP2 and JCSP.
Synopsis
fifoBuffer :: forall a. Int -> Chanin a -> Chanout a -> CHP ()
infiniteBuffer :: forall a. Chanin a -> Chanout a -> CHP ()
accumulatingInfiniteBuffer :: forall a. Chanin a -> Chanout [a] -> CHP ()
overflowingBuffer :: forall a. Int -> Chanin a -> Chanout a -> CHP ()
overwritingBuffer :: forall a. Int -> Chanin a -> Chanout a -> CHP ()
Documentation
fifoBuffer :: forall a. Int -> Chanin a -> Chanout a -> CHP ()Source
Acts like a limited capacity FIFO buffer of the given size. When it is full it accepts no input, and when it is empty it offers no output.
infiniteBuffer :: forall a. Chanin a -> Chanout a -> CHP ()Source
Acts like a FIFO buffer with unlimited capacity. Use with caution; make sure you do not let the buffer grow so large that it eats up all your memory. When it is empty, it offers no output. It always accepts input.
accumulatingInfiniteBuffer :: forall a. Chanin a -> Chanout [a] -> CHP ()Source

Acts like a FIFO buffer with unlimited capacity, but accumulates sequential inputs into a list which it offers in a single output. Use with caution; make sure you do not let the buffer grow so large that it eats up all your memory. When it is empty, it offers the empty list. It always accepts input. Once it has sent out a value (or values) it removes them from its internal storage.

Added in version 1.2.0.

overflowingBuffer :: forall a. Int -> Chanin a -> Chanout a -> CHP ()Source
Acts like a FIFO buffer of limited capacity, except that when it is full, it always accepts input and discards it. When it is empty, it does not offer output.
overwritingBuffer :: forall a. Int -> Chanin a -> Chanout a -> CHP ()Source
Acts like a FIFO buffer of limited capacity, except that when it is full, it always accepts input and pushes out the oldest item in the buffer. When it is empty, it does not offer output.
Produced by Haddock version 2.4.2