aws-kinesis-client-0.4.0.2: A producer & consumer client library for AWS Kinesis

CopyrightCopyright © 2013-2015 PivotCloud, Inc.
LicenseApache-2.0
MaintainerJon Sterling <jsterling@alephcloud.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Aws.Kinesis.Client.Internal.Queue

Description

 

Synopsis

Documentation

class BoundedCloseableQueue q α | q -> α where Source

A signature for bounded, closeable queues.

Methods

newQueue Source

Arguments

:: Natural

the size n of the queue

-> IO q 

closeQueue :: q -> IO () Source

writeQueue :: q -> α -> IO Bool Source

Returns False if and only if the queue is closed. If the queue is full this function shall block.

tryWriteQueue :: q -> α -> 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 α) Source

Returns Nothing if and only if the queue is closed. If this queue is empty this function blocks.

takeQueueTimeout Source

Arguments

:: q 
-> Natural

the number of items n to take

-> Natural

the timeout t in microseconds

-> IO [α] 

Take up to n items from the queue with a timeout of t.

isEmptyQueue :: q -> IO Bool Source

Whether the queue is empty.

isClosedQueue :: q -> IO Bool Source

Whether the queue is closed.

isClosedAndEmptyQueue :: q -> IO Bool Source

Whether the queue is empty and closed. The trivial default implementation may be overridden with one which provides transactional guarantees.