WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] event.py, XendMigrate.py, EventServer.py:
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Thu, 19 May 2005 10:04:05 +0000
Delivery-date: Thu, 19 May 2005 11:02:14 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] event.py, XendMigrate.py, EventServer.py:, BitKeeper Bot <=