On Wed, 4 Mar 2009 06:39:59 -0800 (PST), khawar hasham
<hasham_james_...@yahoo.com> wrote:
Hi
let me first explain the application that I am developing. I have an
application that will use the twisted part as a plugin. this twisted part will
act as server and as client both.
my application call the plugin method to send data to server module using
connectTCP. now the problem is I can not pass on the connection failed
exception to my calling application.
Since you're running the reactor in one thread and the rest of your
application in another thread, your question is basically one of message
passing. You've already found reactor.callFromThread which is good; I
think you just want the slightly more featureful version, available in
twisted.internet.threads, blockingCallFromThread. This is implemented
in terms of callFromThread, but additionally allows the caller to get
the result of the function being called - including waiting on a Deferred
if the function being called returns one. If you switch to this, then
you only need to make Plugin.clientsend return a Deferred which eventually
fires with a result or a Failure.
Jean-Paul
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python