Stability | experimental |
---|---|
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Safe Haskell | None |
Tested with: GHC 7.4.1
This module defines the FIFO queue.
- data FIFO a
- fifoQueue :: FIFO a -> EventQueue
- fifoNull :: FIFO a -> Dynamics Bool
- fifoFull :: FIFO a -> Dynamics Bool
- fifoMaxCount :: FIFO a -> Int
- fifoCount :: FIFO a -> Dynamics Int
- fifoLostCount :: FIFO a -> Dynamics Int
- newFIFO :: EventQueue -> Int -> Simulation (FIFO a)
- dequeueFIFO :: FIFO a -> Process a
- tryDequeueFIFO :: FIFO a -> Dynamics (Maybe a)
- enqueueFIFO :: FIFO a -> a -> Process ()
- tryEnqueueFIFO :: FIFO a -> a -> Dynamics Bool
- enqueueFIFOOrLost :: FIFO a -> a -> Dynamics ()
Documentation
fifoQueue :: FIFO a -> EventQueueSource
Return the event queue.
fifoMaxCount :: FIFO a -> IntSource
The maximum available number of items.
fifoLostCount :: FIFO a -> Dynamics IntSource
Return the number of lost items.
newFIFO :: EventQueue -> Int -> Simulation (FIFO a)Source
Create a new FIFO queue with the specified maximum available number of items.
dequeueFIFO :: FIFO a -> Process aSource
Dequeue from the FIFO queue suspending the process if the queue is empty.
tryDequeueFIFO :: FIFO a -> Dynamics (Maybe a)Source
Try to dequeue from the FIFO queue immediately.
enqueueFIFO :: FIFO a -> a -> Process ()Source
Enqueue the item in the FIFO queue suspending the process if the queue is full.
tryEnqueueFIFO :: FIFO a -> a -> Dynamics BoolSource
Try to enqueue the item in the FIFO queue. Return False
in
the monad if the queue is full.
enqueueFIFOOrLost :: FIFO a -> a -> Dynamics ()Source
Try to enqueue the item in the FIFO queue. If the queue is full then the item will be lost.