diff options
author | Erik Johnston <erik@matrix.org> | 2016-06-02 11:52:32 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-06-03 11:19:22 +0100 |
commit | e043ede4a2f18a47b67bf19368600183554824f7 (patch) | |
tree | 37f0f00d796f7f40fea67c81e6747eaca96b00fc /synapse/util/async.py | |
parent | Make cachedList go a bit faster (diff) | |
download | synapse-e043ede4a2f18a47b67bf19368600183554824f7.tar.xz |
Small optimisation to CacheListDescriptor
Diffstat (limited to 'synapse/util/async.py')
-rw-r--r-- | synapse/util/async.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/synapse/util/async.py b/synapse/util/async.py index 0d6f48e2d8..40be7fe7e3 100644 --- a/synapse/util/async.py +++ b/synapse/util/async.py @@ -102,6 +102,15 @@ class ObservableDeferred(object): def observers(self): return self._observers + def has_called(self): + return self._result is not None + + def has_succeeded(self): + return self._result is not None and self._result[0] is True + + def get_result(self): + return self._result[1] + def __getattr__(self, name): return getattr(self._deferred, name) |