ia64/xen-unstable
changeset 5001:29fd5cbbc564
bitkeeper revision 1.1456.1.1 (428c6495K-Bk3cP5wcdHyT5L6-GVxQ)
event.py, XendMigrate.py, EventServer.py:
Use scheduler.{now,later} instead of reactor.callLater.
reactor.py:
Remove reactor.callLater function -- same as scheduler.{now,later}.
EventServer.py:
Cleanup.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
event.py, XendMigrate.py, EventServer.py:
Use scheduler.{now,later} instead of reactor.callLater.
reactor.py:
Remove reactor.callLater function -- same as scheduler.{now,later}.
EventServer.py:
Cleanup.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author | cl349@firebug.cl.cam.ac.uk |
---|---|
date | Thu May 19 10:04:05 2005 +0000 (2005-05-19) |
parents | 4244ea3af1f5 |
children | 46777a5b3981 |
files | tools/python/xen/web/reactor.py tools/python/xen/xend/EventServer.py tools/python/xen/xend/XendMigrate.py tools/python/xen/xend/server/event.py |
line diff
1.1 --- a/tools/python/xen/web/reactor.py Wed May 18 18:08:47 2005 +0000 1.2 +++ b/tools/python/xen/web/reactor.py Thu May 19 10:04:05 2005 +0000 1.3 @@ -1,9 +1,2 @@ 1.4 -from threading import Timer 1.5 - 1.6 from unix import listenUNIX, connectUNIX 1.7 from tcp import listenTCP, connectTCP 1.8 - 1.9 -def callLater(_delay, _fn, *args, **kwds): 1.10 - timer = Timer(_delay, _fn, args=args, kwargs=kwds) 1.11 - timer.start() 1.12 - return timer
2.1 --- a/tools/python/xen/xend/EventServer.py Wed May 18 18:08:47 2005 +0000 2.2 +++ b/tools/python/xen/xend/EventServer.py Thu May 19 10:04:05 2005 +0000 2.3 @@ -5,8 +5,7 @@ 2.4 import string 2.5 from threading import Lock 2.6 2.7 -#from twisted.internet import reactor 2.8 -from xen.web import reactor 2.9 +import scheduler 2.10 2.11 # subscribe a.b.c h: map a.b.c -> h 2.12 # subscribe a.b.* h: map a.b.* -> h 2.13 @@ -130,7 +129,7 @@ class EventServer: 2.14 self.lock.release() 2.15 2.16 if async: 2.17 - reactor.callLater(0, self.call_handlers, event, val) 2.18 + scheduler.now(self.call_handlers, [event, val]) 2.19 else: 2.20 self.call_handlers(event, val) 2.21
3.1 --- a/tools/python/xen/xend/XendMigrate.py Wed May 18 18:08:47 2005 +0000 3.2 +++ b/tools/python/xen/xend/XendMigrate.py Thu May 19 10:04:05 2005 +0000 3.3 @@ -12,6 +12,7 @@ import types 3.4 from xen.web import reactor 3.5 from xen.web.protocol import Protocol, ClientFactory 3.6 3.7 +import scheduler 3.8 import sxp 3.9 import XendDB 3.10 import EventServer; eserver = EventServer.instance() 3.11 @@ -120,7 +121,7 @@ class SuspendHandler: 3.12 3.13 def start(self): 3.14 self.subscribe(on=True) 3.15 - timer = reactor.callLater(self.timeout, self.onTimeout) 3.16 + timer = scheduler.later(self.timeout, self.onTimeout) 3.17 try: 3.18 self.readyCond.acquire() 3.19 while not self.ready:
4.1 --- a/tools/python/xen/xend/server/event.py Wed May 18 18:08:47 2005 +0000 4.2 +++ b/tools/python/xen/xend/server/event.py Thu May 19 10:04:05 2005 +0000 4.3 @@ -3,6 +3,7 @@ import StringIO 4.4 4.5 from xen.web import reactor, protocol 4.6 4.7 +from xen.xend import scheduler 4.8 from xen.xend import sxp 4.9 from xen.xend import PrettyPrint 4.10 from xen.xend import EventServer; eserver = EventServer.instance() 4.11 @@ -47,7 +48,7 @@ class EventProtocol(protocol.Protocol): 4.12 if self.transport: 4.13 self.transport.loseConnection() 4.14 if self.connected: 4.15 - reactor.callLater(0, self.connectionLost) 4.16 + scheduler.now(self.connectionLost) 4.17 4.18 def connectionLost(self, reason=None): 4.19 self.unsubscribe()