| Copyright | Copyright © 2016-2018 Lars Kuhtz <lakuhtz@gmail.com> Copyright © 2015 PivotCloud Inc. |
|---|---|
| License | Apache-2.0 |
| Maintainer | Lars Kuhtz <lakuhtz@gmail.com> |
| Stability | experimental |
| Safe Haskell | Safe |
| Language | Haskell2010 |
System.Logger.Internal.Queue
Description
Synopsis
- class BoundedCloseableQueue q a | q -> a where
- data FairTBMQueue α
- data TBMQueue a
- data TBMChan a
Documentation
class BoundedCloseableQueue q a | q -> a where Source #
Minimal complete definition
Methods
newQueue :: Natural -> IO q Source #
closeQueue :: q -> IO () Source #
writeQueue :: q -> a -> IO Bool Source #
Returns False if and only if the queue
is closed. If the queue is full this function blocks.
tryWriteQueue :: q -> a -> IO (Maybe Bool) Source #
Non-blocking version of writeQueue. Returns Nothing if the
queue was full. Otherwise it returns 'Just True' if the value
was successfully written and 'Just False' if the queue was closed.
readQueue :: q -> IO (Maybe a) Source #
Returns Nothing if and only if the queue is
closed. If this queue is empty this function blocks.
Instances
| BoundedCloseableQueue (TBMQueue a) a Source # | |
| BoundedCloseableQueue (TBMChan a) a Source # | |
| BoundedCloseableQueue (FairTBMQueue a) a Source # | |
Defined in System.Logger.Internal.Queue Methods newQueue :: Natural -> IO (FairTBMQueue a) Source # closeQueue :: FairTBMQueue a -> IO () Source # writeQueue :: FairTBMQueue a -> a -> IO Bool Source # tryWriteQueue :: FairTBMQueue a -> a -> IO (Maybe Bool) Source # | |
data FairTBMQueue α Source #
Instances
| BoundedCloseableQueue (FairTBMQueue a) a Source # | |
Defined in System.Logger.Internal.Queue Methods newQueue :: Natural -> IO (FairTBMQueue a) Source # closeQueue :: FairTBMQueue a -> IO () Source # writeQueue :: FairTBMQueue a -> a -> IO Bool Source # tryWriteQueue :: FairTBMQueue a -> a -> IO (Maybe Bool) Source # | |
TBMQueue is an abstract type representing a bounded closeable
FIFO queue.
Instances
| BoundedCloseableQueue (TBMQueue a) a Source # | |
TBMChan is an abstract type representing a bounded closeable
FIFO channel.
Instances
| BoundedCloseableQueue (TBMChan a) a Source # | |