Skip to content

Commit

Permalink
coro checking
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-khramov committed Jan 24, 2019
1 parent 3cd06fb commit 11300af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions kafka_transport/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import msgpack
import uuid
import time
from types import CoroutineType
from aiokafka import AIOKafkaConsumer, AIOKafkaProducer

from .errors import KafkaTransportError
Expand Down Expand Up @@ -104,7 +103,7 @@ async def consume_messages(consumer: AIOKafkaConsumer, callback):
"key": decode_key(msg.key),
"value": value
})
if type(result) is CoroutineType:
if asyncio.iscoroutine(result):
asyncio.ensure_future(result)
except:
logger.warning("Error during calling handler with data: %s", str(value))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
long_description = fh.read()

setup(name='kafka-transport',
version='0.6.4',
version='0.6.5',
long_description=long_description,
long_description_content_type="text/markdown",
url='https://github.com/Karma-blockchain/kafka-transport',
Expand Down

0 comments on commit 11300af

Please sign in to comment.