[CalendarServer-changes] [12566] twext/trunk/twext/enterprise/queue.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:24:36 PDT 2014


Revision: 12566
          http://trac.calendarserver.org//changeset/12566
Author:   cdaboo at apple.com
Date:     2014-02-04 16:10:47 -0800 (Tue, 04 Feb 2014)
Log Message:
-----------
Needed for schedule-q work to help track pending work during unit tests.

Modified Paths:
--------------
    twext/trunk/twext/enterprise/queue.py

Modified: twext/trunk/twext/enterprise/queue.py
===================================================================
--- twext/trunk/twext/enterprise/queue.py	2014-02-04 23:58:26 UTC (rev 12565)
+++ twext/trunk/twext/enterprise/queue.py	2014-02-05 00:10:47 UTC (rev 12566)
@@ -115,7 +115,7 @@
     (in the worst case) pass from worker->controller->controller->worker.
     """
 
-    def performWork(table, workID):
+    def performWork(table, workID): #@NoSelf
         """
         @param table: The table where work is waiting.
         @type table: L{TableSyntax}
@@ -288,7 +288,7 @@
     the exact timing and location of the work execution may differ.
 
     L{WorkItem}s may be constrained in the ordering and timing of their
-    execution, to control concurrency and for performance reasons repsectively.
+    execution, to control concurrency and for performance reasons respectively.
 
     Although all the usual database mutual-exclusion rules apply to work
     executed in L{WorkItem.doWork}, implicit database row locking is not always
@@ -309,7 +309,7 @@
           cheap operations all have to wait for the expensive ones to complete,
           but continue to consume whatever database resources they were using.
 
-    In order to ameliorate these problems with potentiallly concurrent work
+    In order to ameliorate these problems with potentially concurrent work
     that uses the same resources, L{WorkItem} provides a database-wide mutex
     that is automatically acquired at the beginning of the transaction and
     released at the end.  To use it, simply L{align
@@ -375,7 +375,6 @@
         will be taken care of by the job queueing machinery.
         """
 
-
     @classmethod
     def forTable(cls, table):
         """
@@ -952,6 +951,7 @@
         self._whenProposed = Deferred()
         self._whenExecuted = Deferred()
         self._whenCommitted = Deferred()
+        self.workItem = None
 
 
     def _start(self):
@@ -963,6 +963,7 @@
         created = self.workItemType.create(self.txn, **self.kw)
 
         def whenCreated(item):
+            self.workItem = item
             self._whenProposed.callback(self)
 
             @self.txn.postCommit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/b341c441/attachment.html>


More information about the calendarserver-changes mailing list