[CalendarServer-changes] [10248] CalendarServer/branches/users/glyph/queue-locking-and-timing
source_changes at macosforge.org
source_changes at macosforge.org
Fri Jan 4 16:39:06 PST 2013
Revision: 10248
http://trac.calendarserver.org//changeset/10248
Author: glyph at apple.com
Date: 2013-01-04 16:39:06 -0800 (Fri, 04 Jan 2013)
Log Message:
-----------
Sometimes, things need to clean up database state before the transaction is committed. Extend the IAsyncTransaction interface to let them do so.
Modified Paths:
--------------
CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/ienterprise.py
Property Changed:
----------------
CalendarServer/branches/users/glyph/queue-locking-and-timing/
Modified: CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/ienterprise.py
===================================================================
--- CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/ienterprise.py 2013-01-05 00:39:05 UTC (rev 10247)
+++ CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/ienterprise.py 2013-01-05 00:39:06 UTC (rev 10248)
@@ -113,6 +113,19 @@
"""
+ def preCommit(operation):
+ """
+ Perform the given operation when this L{IAsyncTransaction}'s C{commit}
+ method is called, but before the underlying transaction commits. If
+ any exception is raised by this operation, underlying database commit
+ will be blocked and rollback run instead.
+
+ @param operation: a 0-argument callable that may return a L{Deferred}.
+ If it does, then the subsequent operations added by L{postCommit}
+ will not fire until that L{Deferred} fires.
+ """
+
+
def postCommit(operation):
"""
Perform the given operation only after this L{IAsyncTransaction}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130104/aed0ecd1/attachment.html>
More information about the calendarserver-changes
mailing list