Skip to main content

Asyncio kinesis client

Project description

AIOKinesis
==========

Asyncio client library for AWS Kinesis

Installation
------------
```
pip install aiokinesis
```

AIOKinesisProducer
------------------
Usage:
```python
import asycio
from aiokinesis import AIOKinesisProducer

async def send_message():
loop = asyncio.get_event_loop()
producer = AIOKinesisProducer('my-stream-name', loop, region_name='us-east-1')
await producer.start()

await producer.send('partition-key', {'data': 'blah'})

await asyncio.sleep(1)
await producer.stop()

loop.run_until_complete(send_message())
```
Limitations:
- Stopping the producer before all messages are sent will prevent in flight messages from being sent
- AIOKinesis only supports one shard so the producer is rate limited to 5 requests per rolling second

AIOKinesisConsumer
------------------
Usage:
```python
import asyncio
from aiokinesis import AIOKinesisConsumer

async def get_messages():
loop = asyncio.get_event_loop()
consumer = AIOKinesisConsumer('my-stream-name', loop, region_name='us-east-1')
await consumer.start()

try:
async for message in consumer:
print("Consumed message: ", message)
except KeyboardInterrupt:
await consumer.stop()

loop.run_until_complete()
```
Limitations:
- AIOKinesis only supports one shard so the consumer is rate limited to 5 requests per rolling second

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiokinesis-0.0.4.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

aiokinesis-0.0.4-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file aiokinesis-0.0.4.tar.gz.

File metadata

  • Download URL: aiokinesis-0.0.4.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for aiokinesis-0.0.4.tar.gz
Algorithm Hash digest
SHA256 d0fc0c7341a23cb4d933d1e891cfbe8ae41075c674cdd7795c8b756c29ec97a2
MD5 4af0b1135413797b7d1cdd357c96bfba
BLAKE2b-256 97af1f5a0ee5f2cb3a00ab838ff998cc03bc5ae76a574856549e8bdae48dda93

See more details on using hashes here.

File details

Details for the file aiokinesis-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for aiokinesis-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ca6e73a13aac3e5ee0c48ddd95b5239e01d3169a995ef9a9ce7e97965d9d1101
MD5 6ad1aa4320e516c6a5291721c27799a9
BLAKE2b-256 030500ae1898c467b19720389cb5e6d71c0ee8aa2d05cb9d79165172526fc586

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page