diff options
author | Dana Powers <dana.powers@gmail.com> | 2018-03-22 18:08:30 -0700 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2018-03-22 18:08:30 -0700 |
commit | 996ccdca5cf2c341ecb089e09bfb11f4f26f721f (patch) | |
tree | c81ac3fc8e935de1a452b95c8d6805f2a4fa8284 /kafka/producer/base.py | |
parent | 5fe90bcdee88523acb31af6ba0dfa47514e1f004 (diff) | |
download | kafka-python-simple_producer_async_send.tar.gz |
Check kwargs for deprecated async optionsimple_producer_async_send
Diffstat (limited to 'kafka/producer/base.py')
-rw-r--r-- | kafka/producer/base.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/kafka/producer/base.py b/kafka/producer/base.py index 23e8e31..e8d6c3d 100644 --- a/kafka/producer/base.py +++ b/kafka/producer/base.py @@ -268,6 +268,8 @@ class Producer(object): defaults to 30. Deprecated Arguments: + async (bool, optional): send message using a background thread, + defaults to False. Deprecated, use 'async_send' batch_send (bool, optional): If True, messages are sent by a background thread in batches, defaults to False. Deprecated, use 'async_send' """ @@ -292,7 +294,13 @@ class Producer(object): async_queue_maxsize=ASYNC_QUEUE_MAXSIZE, async_queue_put_timeout=ASYNC_QUEUE_PUT_TIMEOUT, async_log_messages_on_error=ASYNC_LOG_MESSAGES_ON_ERROR, - async_stop_timeout=ASYNC_STOP_TIMEOUT_SECS): + async_stop_timeout=ASYNC_STOP_TIMEOUT_SECS, + **kwargs): + + # async renamed async_send for python3.7 support + if 'async' in kwargs: + log.warning('Deprecated async option found -- use async_send') + async_send = kwargs['async'] if async_send: assert batch_send_every_n > 0 |