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.
- 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.