[CalendarServer-changes] [8387] CalendarServer/branches/users/glyph/parallel-upgrade/twext/internet/ spawnsvc.py
source_changes at macosforge.org
source_changes at macosforge.org
Sat Dec 3 00:38:26 PST 2011
Revision: 8387
http://trac.macosforge.org/projects/calendarserver/changeset/8387
Author: glyph at apple.com
Date: 2011-12-03 00:38:26 -0800 (Sat, 03 Dec 2011)
Log Message:
-----------
allow for passing through childFDs
Modified Paths:
--------------
CalendarServer/branches/users/glyph/parallel-upgrade/twext/internet/spawnsvc.py
Modified: CalendarServer/branches/users/glyph/parallel-upgrade/twext/internet/spawnsvc.py
===================================================================
--- CalendarServer/branches/users/glyph/parallel-upgrade/twext/internet/spawnsvc.py 2011-12-03 08:38:17 UTC (rev 8386)
+++ CalendarServer/branches/users/glyph/parallel-upgrade/twext/internet/spawnsvc.py 2011-12-03 08:38:26 UTC (rev 8387)
@@ -184,7 +184,7 @@
self._stopAllDeferred = None
- def spawn(self, hereProto, thereProto):
+ def spawn(self, hereProto, thereProto, childFDs=None):
"""
Spawn a subprocess with a connected pair of protocol objects, one in
the current process, one in the subprocess.
@@ -194,6 +194,9 @@
@param thereProto: a top-level class or function that will be imported
and called in the spawned subprocess.
+ @param childFDs: File descriptors to share with the subprocess; same
+ format as L{IReactorProcess.spawnProcess}.
+
@return: a L{Deferred} that fires when C{hereProto} is ready.
"""
if not self.running:
@@ -202,7 +205,8 @@
name = qual(thereProto)
self.reactor.spawnProcess(
BridgeProtocol(self, hereProto), sys.executable,
- [sys.executable, '-m', __name__, name], os.environ
+ [sys.executable, '-m', __name__, name], os.environ,
+ childFDs=childFDs
)
return succeed(hereProto)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20111203/ff299519/attachment-0001.html>
More information about the calendarserver-changes
mailing list