From 7cb3321b94a2a05ce8b2f1325d45dc99f743aae2 Mon Sep 17 00:00:00 2001 From: James Bunton Date: Fri, 4 Jul 2008 12:53:33 +1000 Subject: [PATCH] asyncsched calls asyncore.loop(count=1) --- lib/asyncsched.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/asyncsched.py b/lib/asyncsched.py index c8b0871..428fcf3 100644 --- a/lib/asyncsched.py +++ b/lib/asyncsched.py @@ -33,7 +33,7 @@ def schedule(delay, func, args=[], kwargs={}): heapq.heappush(tasks, task) return task -def loop(timeout=30.0): +def loop(timeout=30.0, use_poll=False): global running running = True oldhandler = signal.signal(signal.SIGTERM, exit) @@ -48,7 +48,7 @@ def loop(timeout=30.0): if tasks: t = max(min(t, tasks[0].time - now), 0) - asyncore.poll(timeout=t) + asyncore.loop(timeout=t, count=1, use_poll=use_poll) signal.signal(signal.SIGTERM, oldhandler) -- 2.39.2