We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ad0be6 commit e797f62Copy full SHA for e797f62
kafka/producer/base.py
@@ -212,3 +212,9 @@ def stop(self, timeout=1):
212
213
if self.proc.is_alive():
214
self.proc.terminate()
215
+
216
+ def __del__(self):
217
+ try:
218
+ self.stop()
219
+ except BrokenPipeError: # Already stopped
220
+ pass
kafka/util.py
@@ -151,3 +151,6 @@ def stop(self):
151
# noinspection PyAttributeOutsideInit
152
self.timer = None
153
self.fn = None
154
155
156
0 commit comments