[conduit] Sleep between handle_requests to prevent CPU usage on python 2.6



commit ede6cc86ede22ec45480c51cea2825a9b48456fd
Author: John Stowers <john stowers gmail com>
Date:   Fri Apr 17 21:08:25 2009 +1200

    Sleep between handle_requests to prevent CPU usage on python 2.6
---
 ChangeLog                                    |    5 +++++
 conduit/modules/NetworkModule/XMLRPCUtils.py |    3 +++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d414f27..7bca147 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-17 John Stowers  <john stowers gmail com>
+
+	* conduit/modules/NetworkModule/XMLRPCUtils.py:
+	Sleep between handle_requests to prevent CPU usage on python 2.6
+
 2009-04-08 John Stowers  <john stowers gmail com>
 
 	* conduit/platform/FileGio.py:
diff --git a/conduit/modules/NetworkModule/XMLRPCUtils.py b/conduit/modules/NetworkModule/XMLRPCUtils.py
index 5b56175..f806e76 100644
--- a/conduit/modules/NetworkModule/XMLRPCUtils.py
+++ b/conduit/modules/NetworkModule/XMLRPCUtils.py
@@ -12,6 +12,8 @@ import cPickle
 import xmlrpclib
 import SimpleXMLRPCServer
 import logging
+import sys
+import time
 
 #One log for the client
 clog = logging.getLogger("modules.Network.C")
@@ -78,6 +80,7 @@ class StoppableXMLRPCServer(SimpleXMLRPCServer.SimpleXMLRPCServer):
     def serve(self):
         self.socket.setblocking(0)
         while not self.closed:
+            time.sleep(0.15)
             self.handle_request()        
             
     def get_request(self):



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