[CalendarServer-changes] [9661] CalendarServer/branches/users/glyph/q

source_changes at macosforge.org source_changes at macosforge.org
Sat Aug 11 01:55:32 PDT 2012


Revision: 9661
          http://trac.macosforge.org/projects/calendarserver/changeset/9661
Author:   glyph at apple.com
Date:     2012-08-11 01:55:32 -0700 (Sat, 11 Aug 2012)
Log Message:
-----------
Correct the example.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/q/twext/enterprise/queue.py

Property Changed:
----------------
    CalendarServer/branches/users/glyph/q/

Modified: CalendarServer/branches/users/glyph/q/twext/enterprise/queue.py
===================================================================
--- CalendarServer/branches/users/glyph/q/twext/enterprise/queue.py	2012-08-11 08:55:31 UTC (rev 9660)
+++ CalendarServer/branches/users/glyph/q/twext/enterprise/queue.py	2012-08-11 08:55:32 UTC (rev 9661)
@@ -67,10 +67,10 @@
     @inlineCallbacks
     def makeSomeCoupons(txn):
         # Note, txn was started before, will be committed later...
-        q = queueFromTransaction(txn)
         for customerID in (yield Select([schema.CUSTOMER.CUSTOMER_ID],
                                         From=schema.CUSTOMER).on(txn)):
-            q.enqueueWork(CouponWork, customerID=customerID)
+            # peerPool is a PeerConnectionPool
+            peerPool.enqueueWork(txn, CouponWork, customerID=customerID)
 
 
 """
@@ -93,7 +93,7 @@
 from twext.enterprise.dal.syntax import TableSyntax, SchemaSyntax
 from twext.enterprise.dal.model import ProcedureCall
 from twext.enterprise.dal.syntax import NamedValue
-from twext.enterprise.dal.record import fromTable
+from twext.enterprise.dal.record import Record, fromTable
 from twisted.python.failure import Failure
 from twisted.internet.defer import passthru
 from twext.enterprise.dal.model import Table, Schema, SQLType, Constraint
@@ -194,7 +194,7 @@
 
 
 
-class WorkItem(object):
+class WorkItem(Record):
     """
     An item of work.
 
@@ -616,7 +616,7 @@
     @ivar workItemType: The type of work to be enqueued by this L{WorkProposal}
     @type workItemType: L{WorkItem} subclass
 
-    @ivar kw: The keyword arguments to pass to C{self.workItemType} to
+    @ivar kw: The keyword arguments to pass to C{self.workItemType.create} to
         construct it.
     @type kw: L{dict}
     """
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120811/50c01d3d/attachment.html>


More information about the calendarserver-changes mailing list