[Checkins] SVN: Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/ remove code related to processing in threads

Godefroid Chapelle gotcha at bubblenet.be
Mon Mar 8 06:21:58 EST 2010


Log message for revision 109823:
  remove code related to processing in threads
  

Changed:
  U   Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/interfaces.py
  U   Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/service.py
  U   Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/testing.py

-=-
Modified: Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/interfaces.py
===================================================================
--- Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/interfaces.py	2010-03-08 11:03:18 UTC (rev 109822)
+++ Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/interfaces.py	2010-03-08 11:21:57 UTC (rev 109823)
@@ -131,28 +131,7 @@
     def processNext():
         """Process the next job in the queue."""
 
-    def process():
-        """Process all scheduled jobs.
 
-        This call blocks the thread it is running in.
-        """
-
-    def startProcessing():
-        """Start processing jobs.
-
-        This method has to be called after every server restart.
-        """
-
-    def stopProcessing():
-        """Stop processing jobs."""
-
-    def isProcessing():
-        """Check whether the jobs are being processed.
-
-        Return a boolean representing the state.
-        """
-
-
 class IJob(interface.Interface):
     """An internal job object."""
 

Modified: Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/service.py
===================================================================
--- Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/service.py	2010-03-08 11:03:18 UTC (rev 109822)
+++ Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/service.py	2010-03-08 11:21:57 UTC (rev 109823)
@@ -20,7 +20,6 @@
 from zope import component
 from zope.app.container import contained
 from zope.component.interfaces import ComponentLookupError
-from zope.traversing.api import getParents
 import BTrees
 import datetime
 import logging
@@ -142,29 +141,6 @@
         """See interfaces.ITaskService"""
         return str(self.jobs[jobid].error)
 
-    def startProcessing(self):
-        """See interfaces.ITaskService"""
-        if self.__parent__ is None:
-            return
-        if self._scheduledJobs is None:
-            self._scheduledJobs = self.family.IOB.Tree()
-        if self._scheduledQueue is None:
-            self._scheduledQueue = zc.queue.PersistentQueue()
-        # Create the path to the service within the DB.
-        servicePath = [parent.__name__ for parent in getParents(self)
-                       if parent.__name__]
-        servicePath.reverse()
-        servicePath.append(self.__name__)
-
-    def stopProcessing(self):
-        """See interfaces.ITaskService"""
-        if self.__name__ is None:
-            return
-
-    def isProcessing(self):
-        """See interfaces.ITaskService"""
-        return False
-
     def hasJobsWaiting(self, now=None):
         # If there is are any simple jobs in the queue, we have work to do.
         if self._queue:
@@ -226,11 +202,6 @@
         job.completed = datetime.datetime.now()
         return True
 
-    def process(self, now=None):
-        """See interfaces.ITaskService"""
-        while self.processNext(now):
-            pass
-
     def _pullJob(self, now=None):
         # first move new cron jobs from the scheduled queue into the cronjob
         # list

Modified: Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/testing.py
===================================================================
--- Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/testing.py	2010-03-08 11:03:18 UTC (rev 109822)
+++ Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/testing.py	2010-03-08 11:21:57 UTC (rev 109823)
@@ -149,18 +149,6 @@
         """See interfaces.ITaskService"""
         return str(self.jobs[jobid].error)
 
-    def startProcessing(self):
-        """See interfaces.ITaskService"""
-        raise NotImplementedError("Stub doesn't startProcessing")
-
-    def stopProcessing(self):
-        """See interfaces.ITaskService"""
-        raise NotImplementedError("Stub doesn't stopProcessing")
-
-    def isProcessing(self):
-        """See interfaces.ITaskService"""
-        return False
-
     def processNext(self):
         job = self._queue.pull()
         jobtask = zope.component.getUtility(
@@ -173,8 +161,3 @@
             job.error = error
             job.status = interfaces.ERROR
         job.completed = datetime.datetime.now()
-
-    def process(self):
-        """See interfaces.ITaskService"""
-        while self._queue:
-            self.processNext()



More information about the checkins mailing list