[CalendarServer-changes] [10271] CalendarServer/branches/users/glyph/queue-locking-and-timing
source_changes at macosforge.org
source_changes at macosforge.org
Fri Jan 4 16:39:38 PST 2013
Revision: 10271
http://trac.calendarserver.org//changeset/10271
Author: glyph at apple.com
Date: 2013-01-04 16:39:38 -0800 (Fri, 04 Jan 2013)
Log Message:
-----------
More illustrative name.
Modified Paths:
--------------
CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/queue.py
CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/test/test_queue.py
Property Changed:
----------------
CalendarServer/branches/users/glyph/queue-locking-and-timing/
Modified: CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/queue.py
===================================================================
--- CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/queue.py 2013-01-05 00:39:36 UTC (rev 10270)
+++ CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/queue.py 2013-01-05 00:39:38 UTC (rev 10271)
@@ -827,15 +827,16 @@
-class ImmediatePerformer(object):
+class LocalPerformer(object):
"""
- Implementor of C{performWork} that does its work immediately, regardless.
+ Implementor of C{performWork} that does its work in the local process,
+ regardless of other conditions.
"""
implements(_IWorkPerformer)
def __init__(self, txnFactory):
"""
- Create this L{ImmediatePerformer} with a transaction factory.
+ Create this L{LocalPerformer} with a transaction factory.
"""
self.txnFactory = txnFactory
@@ -1123,7 +1124,7 @@
if self.peers and not onlyLocally:
return sorted(self.peers, lambda p: p.currentLoadEstimate())[0]
else:
- return ImmediatePerformer(self.transactionFactory)
+ return LocalPerformer(self.transactionFactory)
def performWorkForPeer(self, table, workID):
Modified: CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/test/test_queue.py
===================================================================
--- CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/test/test_queue.py 2013-01-05 00:39:36 UTC (rev 10270)
+++ CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/test/test_queue.py 2013-01-05 00:39:38 UTC (rev 10271)
@@ -39,7 +39,7 @@
from twisted.application.service import Service, MultiService
from twext.enterprise.queue import (
- ImmediatePerformer, _IWorkPerformer, WorkerConnectionPool, SchemaAMP,
+ LocalPerformer, _IWorkPerformer, WorkerConnectionPool, SchemaAMP,
TableSyntaxByName
)
@@ -214,7 +214,7 @@
or outgoing), then it chooses an implementation of C{performWork} that
simply executes the work locally.
"""
- self.checkPerformer(ImmediatePerformer)
+ self.checkPerformer(LocalPerformer)
def test_choosingPerformerWithLocalCapacity(self):
@@ -435,7 +435,7 @@
# is not the fact with a raw t.w.enterprise transaction. Should
# probably do something with components.
return txn.enqueue(DummyWorkItem, a=3, b=4, workID=4321,
- notBefore=datetime.datetime.now())
+ notBefore=datetime.datetime.utcnow())
result = yield inTransaction(self.store.newTransaction, operation)
# Wait for it to be executed. Hopefully this does not time out :-\.
yield result.whenExecuted()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130104/2f00f24e/attachment-0001.html>
More information about the calendarserver-changes
mailing list