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
return resp
def stop(self):
def stop(self, timeout=None):
"""
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:
log.warning("producer.stop() called, but producer is not async")
log.warning('producer.stop() called, but producer is not async')
return
if self.stopped:
log.warning("producer.stop() called, but producer is already stopped")
log.warning('producer.stop() called, but producer is already stopped')
return
if self.async: