Stability | experimental |
---|---|
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Safe Haskell | Safe-Inferred |
Tested with: GHC 7.6.3
This module defines the LIFO queue.
- data LIFO a
- lifoQueue :: LIFO a -> EventQueue
- lifoNull :: LIFO a -> Dynamics Bool
- lifoFull :: LIFO a -> Dynamics Bool
- lifoMaxCount :: LIFO a -> Int
- lifoCount :: LIFO a -> Dynamics Int
- lifoLostCount :: LIFO a -> Dynamics Int
- lifoEnqueue :: LIFO a -> Signal a
- lifoDequeue :: LIFO a -> Signal a
- lifoEnqueueLost :: LIFO a -> Signal a
- newLIFO :: EventQueue -> Int -> Simulation (LIFO a)
- dequeueLIFO :: LIFO a -> Process a
- tryDequeueLIFO :: LIFO a -> Dynamics (Maybe a)
- enqueueLIFO :: LIFO a -> a -> Process ()
- tryEnqueueLIFO :: LIFO a -> a -> Dynamics Bool
- enqueueLIFOOrLost :: LIFO a -> a -> Dynamics ()
Documentation
lifoQueue :: LIFO a -> EventQueueSource
Return the event queue.
lifoMaxCount :: LIFO a -> IntSource
The maximum available number of items.
lifoLostCount :: LIFO a -> Dynamics IntSource
Return the number of lost items.
lifoEnqueue :: LIFO a -> Signal aSource
Return a signal that notifies when any item is enqueued.
lifoDequeue :: LIFO a -> Signal aSource
Return a signal that notifies when any item is dequeued.
lifoEnqueueLost :: LIFO 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
enqueueLIFOOrLost
.
newLIFO :: EventQueue -> Int -> Simulation (LIFO a)Source
Create a new LIFO queue with the specified maximum available number of items.
dequeueLIFO :: LIFO a -> Process aSource
Dequeue from the LIFO queue suspending the process if the queue is empty.
tryDequeueLIFO :: LIFO a -> Dynamics (Maybe a)Source
Try to dequeue from the LIFO queue immediately.
enqueueLIFO :: LIFO a -> a -> Process ()Source
Enqueue the item in the LIFO queue suspending the process if the queue is full.
tryEnqueueLIFO :: LIFO a -> a -> Dynamics BoolSource
Try to enqueue the item in the LIFO queue. Return False
in
the monad if the queue is full.
enqueueLIFOOrLost :: LIFO a -> a -> Dynamics ()Source
Try to enqueue the item in the LIFO queue. If the queue is full then the item will be lost.