[Twisted-Python] where to begin

Andrew Bennetts andrew-twisted at puzzling.org
Tue Feb 11 17:56:46 MST 2003


On Tue, Feb 11, 2003 at 07:02:39AM -0500, Christopher Armstrong wrote:
> On Tue, Feb 11, 2003 at 04:35:38PM +1100, Andrew Bennetts wrote:
> > On Tue, Feb 11, 2003 at 04:59:49PM +1300, Rob Brown-Bayliss wrote:
> > > Every thing seems to link on to something else, deffereds, it's own web
> > > servewr etc, it seems like it's a joke, or if not then certianly
> > > overkill for sending data over sockets.
> > 
> > That's a natural by-product of Twisted being a framework, unfortunately;
> > it's hard to take-or-leave each individual piece, you basically have to take
> > the whole framework or none of it.
> 
> I really don't like how this was answered :) You _don't_ need to take
> the entire framework; e.g., you don't need to import the web server,
> mail server, etc, unless you want to use them. Deferreds are an
> important fundamental thing in Twisted, however; they're one of the
> basic abstractions that we use a *lot* in asynchronous
> programming. Also, there's nothing stopping someone from tearing apart
> Twisted and distributing only the parts they need with their
> applications, web server be damned. ;-)

Yes, by the "framework", I really meant twisted.internet.  The rest of
Twisted is largely just pre-built utilities for twisted.internet, to save
you the work of e.g. writing your own web server :)

So, to be clear: when I was talking about Twisted in the previous mail, I
was really only referring to "core" Twisted, i.e. twisted.internet.

> Also, I should note the package layout: twisted.internet is the very
> basic stuff that your Twisted app will never be
> without. twisted.python has a lot of utilities that twisted.internet
> and other packages use. twisted.protocols gives you all the basic
> protocol support. These three packages are the most fundamental to
> Twisted. The rest are mainly application-level packages.

Which reminds me; we probably need to document this more up-front.  If a
newbie can realise that "only" twisted.{internet,protocols,python} is what
they need to get started, and the rest of Twisted is effectively just
libraries using that framework, then it (hopefully) makes learning it all
much easier.

> In addition to these, though, it sounds like Rob will also want to use
> twisted.spread (and twisted.cred) for his application. Most of the
> rest is unneeded.

Except that every network server evolves to the point where it is also a web
server ;)

-Andrew.





More information about the Twisted-Python mailing list