Stability | experimental |
---|---|
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Safe Haskell | Safe-Inferred |
Tested with: GHC 7.6.3
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
- fifoEnqueue :: FIFO a -> Signal a
- fifoDequeue :: FIFO a -> Signal a
- fifoEnqueueLost :: FIFO a -> Signal a
- 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.
fifoEnqueue :: FIFO a -> Signal aSource
Return a signal that notifies when any item is enqueued.
fifoDequeue :: FIFO a -> Signal aSource
Return a signal that notifies when any item is dequeued.
fifoEnqueueLost :: FIFO a -> Signal aSource
Return a signal which notifies that the item was lost when
attempting to add it to the full queue with help of
enqueueFIFOOrLost
.
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.