Asyncio kinesis client
Project description
AIOKinesis
==========
Asyncio client library for AWS Kinesis
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()
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
==========
Asyncio client library for AWS Kinesis
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()
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.1.tar.gz
(3.6 kB
view hashes)
Built Distributions
aiokinesis-0.0.1-py3.6.egg
(9.0 kB
view hashes)
Close
Hashes for aiokinesis-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21cfed12656cc92c38848308864517a49696b1143e8c0efd241702dae5a207eb |
|
MD5 | e9157f3a6c71363ca880bbc468e823ee |
|
BLAKE2b-256 | fd6ebb1cfee5d2b5a153c90829d4bef5645b0af72d9576c8a0ad9a24b61962a3 |