[Twisted-Python] Regarding Twisted Matrix

Reza Lotun rlotun at gmail.com
Tue Oct 27 05:57:11 MDT 2009


Hi Naman,

> I tried to implement this:
>
> parent_conn, child_conn = Pipe()
>
> f = defer.Deferred()
> f = threads.deferToThread(start_test.main_func, SCRIPT_PATH,
> TEMP_OUTPUT_PATH, self.output_name, child_conn)

Do you really want to spawn a thread or a process? Since it seems like
you're trying to run a python script, you'd want to spawn a process
(since it also looks like you want to use a pipe for communication
with that process). Twisted has support for spawning processes - see
reactor.spawnProcess and ProcessProtocol:
http://twistedmatrix.com/projects/core/documentation/howto/process.html#auto2

Cheers,
Reza

-- 
Reza Lotun
mobile: +44 (0)7521 310 763
email:  rlotun at gmail.com
work:   reza at tweetdeck.com
twitter: @rlotun




More information about the Twisted-Python mailing list