diff options
author | Mark Haines <mjark@negativecurvature.net> | 2016-06-03 14:51:33 +0100 |
---|---|---|
committer | Mark Haines <mjark@negativecurvature.net> | 2016-06-03 14:51:33 +0100 |
commit | dd6f62ed99033d7c793685b6cce5dfba9d3aff89 (patch) | |
tree | 0044c60b4100253a0875be891bbb4ecfce80d47c /synapse/util/async.py | |
parent | Send updates to the syncing users every ten seconds or immediately if they've... (diff) | |
parent | Merge pull request #833 from matrix-org/markjh/client_ips (diff) | |
download | synapse-dd6f62ed99033d7c793685b6cce5dfba9d3aff89.tar.xz |
Merge branch 'develop' into markjh/synchrotronII
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) |