[CalendarServer-changes] [9631] CalendarServer/branches/users/glyph/q
source_changes at macosforge.org
source_changes at macosforge.org
Sat Aug 11 01:55:06 PDT 2012
Revision: 9631
http://trac.macosforge.org/projects/calendarserver/changeset/9631
Author: glyph at apple.com
Date: 2012-08-11 01:55:06 -0700 (Sat, 11 Aug 2012)
Log Message:
-----------
flesh out interface a little more
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:05 UTC (rev 9630)
+++ CalendarServer/branches/users/glyph/q/twext/enterprise/queue.py 2012-08-11 08:55:06 UTC (rev 9631)
@@ -20,6 +20,7 @@
from twext.enterprise.dal.model import ProcedureCall
from twext.enterprise.dal.syntax import NamedValue
from twext.enterprise.dal.record import fromTable
+from twisted.internet.defer import Deferred
from twext.enterprise.dal.model import Table, Schema, SQLType, Constraint
@@ -365,6 +366,13 @@
+class TransactionFailed(Exception):
+ """
+ A transaction failed.
+ """
+
+
+
class PeerConnectionPool(Service, object):
"""
Each master has a L{PeerConnectionPool} connecting it to all the other
@@ -443,11 +451,16 @@
@return: a L{Deferred} that fires when the work has been completed.
@rtype: L{Deferred} firing L{None}
"""
+ d = Deferred()
@workItem.__txn__.postCommit
@inlineCallbacks
def whenDone():
peer = yield self.choosePeer()
peer.performWork(workItem.__tbl__, workItem.workID)
+ @workItem.__txn__.postAbort
+ def whenFailed():
+ d.errback(TransactionFailed)
+ return d
def startService(self):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120811/0cfb042b/attachment.html>
More information about the calendarserver-changes
mailing list