From 53216a500d2e0d815581ada87379ecece05b05a5 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Wed, 29 Oct 2014 17:02:22 +0000 Subject: Add a run_on_reactor function --- synapse/util/async.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'synapse/util/async.py') 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 -- cgit 1.4.1