[Twisted-Python] Regarding Twisted Matrix

naman jain namanvit at gmail.com
Tue Oct 27 01:44:54 EDT 2009


I have a client server model in twisted, where the server spawns a thread (
basically a test script in python that runs for about 20 mins)
I want to track the progress of the thread, and send the progress to the
client back

So, I write something like this in my server:

parent_conn, child_conn = Pipe()
thread = Process(target = start_test.main_func, args=(SCRIPT_PATH,
TEMP_OUTPUT_PATH, self.output_name, child_conn))

response = parent_conn.recv()
print response //prints like: initialization done

response = parent_conn.recv()
print response // configuration done



But the transport.write calls don't send at the same time. instead they wait
for the thread to finish (coz of thread.join) and then append all the
response and send it back; like "initialization doneconfiguration
thereby defeating the purpose of creating a thread.

How do I give the control to the reactor to write the data back, and still
keep the thread running?
or is there any other way these kinda of progress can be tracked ?
I am kinda stuck with this :(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20091027/39bd7a94/attachment.htm 

More information about the Twisted-Python mailing list