aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki/async.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2012-07-31 16:55:32 +0000
committerRob Austein <sra@hactrn.net>2012-07-31 16:55:32 +0000
commit5622973467cf9f93818a83101b0588d67823d23b (patch)
tree4b427e0fa57f0aad3e2aa251a94aa6d9f68325c0 /rpkid/rpki/async.py
parent5fd1f7c307399b40a7731ae6a87bbd6337aa9a71 (diff)
First cut at allowing I/O loop to run during processing of massive
batches of ROA requests. Not yet well tested, preliminary results look good and I have people waiting for this patch, so checking in now while continuing testing. See #275. svn path=/trunk/; revision=4615
Diffstat (limited to 'rpkid/rpki/async.py')
-rw-r--r--rpkid/rpki/async.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/rpkid/rpki/async.py b/rpkid/rpki/async.py
index a7de6b25..6e9d1edf 100644
--- a/rpkid/rpki/async.py
+++ b/rpkid/rpki/async.py
@@ -385,6 +385,14 @@ def exit_event_loop():
"""
raise ExitNow
+def event_yield(handler, delay = rpki.sundial.timedelta(seconds = 2)):
+ """
+ Use a near-term timer to schedule an event after letting the timer
+ and I/O systems run.
+ """
+ t = timer(handler)
+ t.set(delay)
+
class gc_summary(object):
"""
Periodic summary of GC state, for tracking down memory bloat.