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 HaskellNone
LanguageHaskell2010

Aws.Kinesis.Client.Consumer

Contents

Description

 

Synopsis

The Consumer

data KinesisConsumer Source

The KinesisConsumer maintains state about which shards to pull from.

managedKinesisConsumer :: (MonadIO m, MonadBaseControl IO m) => ConsumerKit -> Codensity m KinesisConsumer Source

This constructs a KinesisConsumer and closes it when you have done with it; this is equivalent to withKinesisConsumer, except that the continuation is replaced with returning the consumer in Codensity.

withKinesisConsumer :: (MonadIO m, MonadBaseControl IO m) => ConsumerKit -> (KinesisConsumer -> m α) -> m α Source

This constructs a KinesisConsumer and closes it when you have done with it.

Commands

consumerSource :: MonadIO m => KinesisConsumer -> Source m Record Source

A conduit for getting records.

readConsumer :: MonadIO m => KinesisConsumer -> m Record Source

Await and read a single record from the consumer.

tryReadConsumer :: MonadIO m => KinesisConsumer -> m (Maybe Record) Source

Try to read a single record from the consumer; if there is non queued up, then Nothing will be returned.

consumerStreamState :: MonadIO m => KinesisConsumer -> m SavedStreamState Source

Get the last read sequence number at each shard.

Consumer Environment

data ConsumerKit Source

The ConsumerKit contains what is needed to initialize a KinesisConsumer.

Constructors

ConsumerKit 

Fields

_ckKinesisKit :: !KinesisKit

The credentials and configuration for making requests to AWS Kinesis.

_ckStreamName :: !StreamName

The name of the stream to consume from.

_ckBatchSize :: !Natural

The number of records to fetch at once from the stream.

_ckIteratorType :: !ShardIteratorType

The type of iterator to consume.

_ckSavedStreamState :: !(Maybe SavedStreamState)

Optionally, an initial stream state. The iterator type in _ckIteratorType will be used for any shards not present in the saved stream state; otherwise, AfterSequenceNumber will be used.

makeConsumerKit :: KinesisKit -> StreamName -> ConsumerKit Source

Create a ConsumerKit with default settings (using iterator type Latest and a batch size of 200).

Lenses