Skip to content

Commit

Permalink
Merge branch 'some_example_files'
Browse files Browse the repository at this point in the history
  • Loading branch information
tvoinarovskyi committed Apr 15, 2016
2 parents 103b390 + fe08bdb commit 6bf6575
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGES
--------

0.1.1 (2016-04-15)
^^^^^^^^^^^^^^^^^^

* Fix packaging issues. Removed unneded files from package.

0.1.0 (2016-04-15)
^^^^^^^^^^^^^^^^^^

Expand Down
2 changes: 1 addition & 1 deletion aiokafka/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys # noqa
PY_35 = sys.version_info >= (3, 5)

__version__ = '0.1.0'
__version__ = '0.1.1'

from .client import AIOKafkaClient # noqa
from .producer import AIOKafkaProducer # noqa
Expand Down
17 changes: 17 additions & 0 deletions examples/simple_consumer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from aiokafka import AIOKafkaConsumer
import asyncio

loop = asyncio.get_event_loop()

async def consume():
consumer = AIOKafkaConsumer(
"my_topic", loop=loop, bootstrap_servers='localhost:9092')
# Get cluster layout and topic/partition allocation
await consumer.start()
try:
async for msg in consumer:
print(msg.value)
finally:
await consumer.stop()

loop.run_until_complete(consume())
17 changes: 17 additions & 0 deletions examples/simple_produce.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from aiokafka import AIOKafkaProducer
import asyncio

loop = asyncio.get_event_loop()

async def send_one():
producer = AIOKafkaProducer(
loop=loop, bootstrap_servers='localhost:9092')
# Get cluster layout and topic/partition allocation
await producer.start()
try:
# Produce messages
await producer.send_and_wait("my_topic", b"Super message")
finally:
await producer.stop()

loop.run_until_complete(send_one())
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_init_with_list(self):
loop=self.loop,
bootstrap_servers=['kafka01:9092', 'kafka02:9092', 'kafka03:9092'])
self.assertEqual(
'<AIOKafkaClient client_id=aiokafka-0.1.0>', client.__repr__())
'<AIOKafkaClient client_id=aiokafka-0.1.1>', client.__repr__())
self.assertEqual(sorted({'kafka01': 9092,
'kafka02': 9092,
'kafka03': 9092}.items()),
Expand Down

0 comments on commit 6bf6575

Please sign in to comment.