diff options
author | Dana Powers <dana.powers@gmail.com> | 2018-01-10 15:56:47 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-10 15:56:47 -0800 |
commit | 0a7492443c78d4791cfdf3d6384c02f1c7757c7b (patch) | |
tree | e25e986965144b1dc5b8e6c12d58794178d0275a /kafka/util.py | |
parent | 794b695e7ceff25834616bb54e32160104040df4 (diff) | |
download | kafka-python-0a7492443c78d4791cfdf3d6384c02f1c7757c7b.tar.gz |
Improve KafkaConsumer cleanup (#1339)
Diffstat (limited to 'kafka/util.py')
-rw-r--r-- | kafka/util.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kafka/util.py b/kafka/util.py index 181f67f..75538dd 100644 --- a/kafka/util.py +++ b/kafka/util.py @@ -167,6 +167,14 @@ class WeakMethod(object): return self._target_id == other._target_id and self._method_id == other._method_id +class Dict(dict): + """Utility class to support passing weakrefs to dicts + + See: https://docs.python.org/2/library/weakref.html + """ + pass + + def try_method_on_system_exit(obj, method, *args, **kwargs): def wrapper(_obj, _meth, *args, **kwargs): try: |