[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] event.py, XendMigrate.py, EventServer.py:



ChangeSet 1.1456.1.1, 2005/05/19 11:04:05+01:00, cl349@xxxxxxxxxxxxxxxxxxxx

        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@xxxxxxxxxxxx>



 web/reactor.py       |    7 -------
 xend/EventServer.py  |    5 ++---
 xend/XendMigrate.py  |    3 ++-
 xend/server/event.py |    3 ++-
 4 files changed, 6 insertions(+), 12 deletions(-)


diff -Nru a/tools/python/xen/web/reactor.py b/tools/python/xen/web/reactor.py
--- a/tools/python/xen/web/reactor.py   2005-05-19 07:02:53 -04:00
+++ b/tools/python/xen/web/reactor.py   2005-05-19 07:02:53 -04:00
@@ -1,9 +1,2 @@
-from threading import Timer
-
 from unix import listenUNIX, connectUNIX
 from tcp import listenTCP, connectTCP
-
-def callLater(_delay, _fn, *args, **kwds):
-    timer = Timer(_delay, _fn, args=args, kwargs=kwds)
-    timer.start()
-    return timer
diff -Nru a/tools/python/xen/xend/EventServer.py 
b/tools/python/xen/xend/EventServer.py
--- a/tools/python/xen/xend/EventServer.py      2005-05-19 07:02:53 -04:00
+++ b/tools/python/xen/xend/EventServer.py      2005-05-19 07:02:53 -04:00
@@ -5,8 +5,7 @@
 import string
 from threading import Lock
 
-#from twisted.internet import reactor
-from xen.web import reactor
+import scheduler
 
 # subscribe a.b.c h: map a.b.c -> h
 # subscribe a.b.* h: map a.b.* -> h
@@ -130,7 +129,7 @@
             self.lock.release()
             
         if async:
-            reactor.callLater(0, self.call_handlers, event, val)
+            scheduler.now(self.call_handlers, [event, val])
         else:
             self.call_handlers(event, val)
 
diff -Nru a/tools/python/xen/xend/XendMigrate.py 
b/tools/python/xen/xend/XendMigrate.py
--- a/tools/python/xen/xend/XendMigrate.py      2005-05-19 07:02:53 -04:00
+++ b/tools/python/xen/xend/XendMigrate.py      2005-05-19 07:02:53 -04:00
@@ -12,6 +12,7 @@
 from xen.web import reactor
 from xen.web.protocol import Protocol, ClientFactory
 
+import scheduler
 import sxp
 import XendDB
 import EventServer; eserver = EventServer.instance()
@@ -120,7 +121,7 @@
 
     def start(self):
         self.subscribe(on=True)
-        timer = reactor.callLater(self.timeout, self.onTimeout)
+        timer = scheduler.later(self.timeout, self.onTimeout)
         try:
             self.readyCond.acquire()
             while not self.ready:
diff -Nru a/tools/python/xen/xend/server/event.py 
b/tools/python/xen/xend/server/event.py
--- a/tools/python/xen/xend/server/event.py     2005-05-19 07:02:53 -04:00
+++ b/tools/python/xen/xend/server/event.py     2005-05-19 07:02:53 -04:00
@@ -3,6 +3,7 @@
 
 from xen.web import reactor, protocol
 
+from xen.xend import scheduler
 from xen.xend import sxp
 from xen.xend import PrettyPrint
 from xen.xend import EventServer; eserver = EventServer.instance()
@@ -47,7 +48,7 @@
         if self.transport:
             self.transport.loseConnection()
         if self.connected:
-            reactor.callLater(0, self.connectionLost)
+            scheduler.now(self.connectionLost)
 
     def connectionLost(self, reason=None):
         self.unsubscribe()

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.