Log deprecation warning for timeout argument in Producer.stop()
This commit is contained in:
@@ -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:
|
||||||
|
Reference in New Issue
Block a user