Skip to content

Commit ccbb189

Browse files
ms7sdpkp
authored andcommitted
Clarify timeout unit (#734)
1 parent cbcb4a6 commit ccbb189

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

kafka/producer/kafka.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,11 @@ def __del__(self):
330330
self.close(timeout=0)
331331

332332
def close(self, timeout=None):
333-
"""Close this producer."""
333+
"""Close this producer.
334+
335+
Arguments:
336+
timeout (float, optional): timeout in seconds to wait for completion.
337+
"""
334338

335339
# drop our atexit handler now to avoid leaks
336340
self._unregister_cleanup()
@@ -476,6 +480,9 @@ def flush(self, timeout=None):
476480
Other threads can continue sending messages while one thread is blocked
477481
waiting for a flush call to complete; however, no guarantee is made
478482
about the completion of messages sent after the flush call begins.
483+
484+
Arguments:
485+
timeout (float, optional): timeout in seconds to wait for completion.
479486
"""
480487
log.debug("Flushing accumulated records in producer.") # trace
481488
self._accumulator.begin_flush()

0 commit comments

Comments
 (0)