[Twisted-Python] Confused about threads

Mark L mark.lachesis at gmail.com
Mon Nov 19 03:44:08 EST 2007


I'm new to twisted, and have read a few pages, but things are going
over my head and I'm not finding the answer I need.

What I want to do is create a class in my python application which
manages network activity and starts the reactor.  I want to run that
class as a thread.

I've done all of this, except when I get to reactor.run().  Then it
says that signal must be started in main.  If I move the reactor.run()
into main then it starts up fine - but it doesn't run in a separate
thread.  I want the network running in the background in a separate
thread so I can manage other server tasks distinctly.

I realise this is probably a critical misunderstanding on my part of
how twisted is meant to be used - so I'd appreciate any clarifications
on this point that I wasn't able to find in the documentation.  Which,
again, is probably just a critical failure of mine to find.


More information about the Twisted-Python mailing list