diff options
author | Dana Powers <dana.powers@gmail.com> | 2018-01-10 13:36:41 -0800 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2018-01-10 13:38:12 -0800 |
commit | 02a3034e95a06c9de00eb6add616b9138d9bcf24 (patch) | |
tree | e25e986965144b1dc5b8e6c12d58794178d0275a /kafka/util.py | |
parent | 794b695e7ceff25834616bb54e32160104040df4 (diff) | |
download | kafka-python-reference_cleanup_close.tar.gz |
Improve KafkaConsumer cleanupreference_cleanup_close
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: |