Log deprecation warning for timeout argument in Producer.stop()

This commit is contained in:
Dana Powers
2015-12-06 12:18:22 -08:00
parent 3b422544ac
commit 31ee4ed2af

View File

@@ -415,16 +415,20 @@ class Producer(object):
raise raise
return resp return resp
def stop(self): def stop(self, timeout=None):
""" """
Stop the producer (async mode). Blocks until async thread completes. Stop the producer (async mode). Blocks until async thread completes.
""" """
if timeout is not None:
log.warning('timeout argument to stop() is deprecated - '
'it will be removed in future release')
if not self.async: if not self.async:
log.warning("producer.stop() called, but producer is not async") log.warning('producer.stop() called, but producer is not async')
return return
if self.stopped: if self.stopped:
log.warning("producer.stop() called, but producer is already stopped") log.warning('producer.stop() called, but producer is already stopped')
return return
if self.async: if self.async: