summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-10-29 17:02:22 +0000
committerErik Johnston <erik@matrix.org>2014-10-29 17:02:22 +0000
commit53216a500d2e0d815581ada87379ecece05b05a5 (patch)
treeaba5393730cee199b6a2b0dc17ef2dc021e68cd1
parentStart filling out and using new events tables (diff)
downloadsynapse-53216a500d2e0d815581ada87379ecece05b05a5.tar.xz
Add a run_on_reactor function
-rw-r--r--synapse/util/async.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/util/async.py b/synapse/util/async.py
index 647ea6142c..bf578f8bfb 100644
--- a/synapse/util/async.py
+++ b/synapse/util/async.py
@@ -21,3 +21,10 @@ def sleep(seconds):
     d = defer.Deferred()
     reactor.callLater(seconds, d.callback, seconds)
     return d
+
+
+def run_on_reactor():
+    """ This will cause the rest of the function to be invoked upon the next
+    iteration of the main loop
+    """
+    return sleep(0)
\ No newline at end of file