[nanny/win32: 52/75] May defer proxy calls from PyroBus
- From: Roberto Majadas <telemaco src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nanny/win32: 52/75] May defer proxy calls from PyroBus
- Date: Tue, 2 Nov 2010 18:55:19 +0000 (UTC)
commit 9f4efc0ab974d870486ee11c4e532e9a1e2974b8
Author: Roberto Majadas <roberto majadas openshine com>
Date: Thu Oct 21 13:37:44 2010 +0200
May defer proxy calls from PyroBus
daemon/src/NannyPyroBus.py | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/daemon/src/NannyPyroBus.py b/daemon/src/NannyPyroBus.py
index 2ce3571..fa6b482 100644
--- a/daemon/src/NannyPyroBus.py
+++ b/daemon/src/NannyPyroBus.py
@@ -38,12 +38,15 @@ def PyroBlockingCallFromThread(reactor, f, *a, **kw):
if se._Semaphore__value == 1 :
se.acquire()
else:
- return
- result = f(*a, **kw)
- queue.put(result)
+ return
+
+ result = defer.maybeDeferred(f, *a, **kw)
+ result.addBoth(queue.put)
reactor.callFromThread(_callFromThread)
result = queue.get()
+ if isinstance(result, failure.Failure):
+ result.raiseException()
return result
class OrgGnomeNanny(Pyro.core.ObjBase):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]