[Twisted-Python] Thinking Twisted (was Re: Need a mother?)

Christopher Armstrong radix at twistedmatrix.com
Tue Mar 18 16:40:36 EST 2003

On Tue, Mar 18, 2003 at 03:03:53PM -0600, Stephen R. Figgins wrote:
> On 3/18/03 11:29 AM, "Tommi Virtanen" <tv at twistedmatrix.com> wrote:
> > BINGO!
> > 
> > 
> > (sorry)

> Since I haven't received an answer to my questions yet, I worry that either
> nobody knows or you are all feeling annoyed reading my barrage of ignorant
> questions. 

Don't mind Tv's troll. Admittedly it was a litte amusing to see a
buzzword-filled post, but nothing any of us would really get annoyed
with. :-)

> The solution needn't be buzzword compliant. I just want to know the twisted
> approach.  Considering what I have described, would you write one server and
> throw in all your basic components as modules to that server?  Would you use
> Twisted's plug-in technology to add new features as you need them?     Would
> you write components as servers/servants, and have them interact with each
> other via PB in a more DO approach?  Would you write a front end server as a
> fa?ade for those components?    It looks like I could do any of the above
> and much more with Twisted.  Is one way better than others?  What has worked
> well for other large scale solutions?

I think what most needs to be defined here is the interactions that
are required between the different services. What hosts/ports the
clients connect to the services with are pretty much irrelevant (i.e.,
facade). Once you have the interactions figured out, you can just use
PB to have the different services talk to each other (if they need to
be on separate hosts), as well as for the clients to talk to the

Also, the plugin/component stuff is mostly fluff. Plugins are only
useful when you want 3rd parties to add functionality to your service
through some application-specific API, and I gather that's not going
to be a requirement for you.

Just know that it's probably simpler than you think. A few python
servers that use PB to talk to each other. :)

> In a couple of articles on Python and Twisted, Aaron Trauring has made the
> point that multiple Twisted services (web, im, email, etc.)  can all run in
> a single process.  Is the single process approach desirable over a multiple
> component approach?  Or is that only desirable when your needs are small and
> your application is unlikely to become CPU bound?

If you need to be able to put the services on separate hosts, then
yeah, you'll need to use separate processes and use PB to talk between
them. If you don't, however, it's much easier and simpler to just let
the services live in the same process and have synchronous access to
all the objects in the system.

 Twisted | Christopher Armstrong: International Man of Twistery
  Radix  |          Release Manager,  Twisted Project
---------+     http://twistedmatrix.com/users/radix.twistd/

More information about the Twisted-Python mailing list