[Twisted-Python] integrating twisted into an existing application

Moshe Zadka twisted at moshez.org
Tue Feb 18 02:14:23 EST 2003

On Tue, 18 Feb 2003, Anthony Baxter <anthony at interlink.com.au> wrote:

> There's a bunch of thorny issues that have to be handled - obviously 
> you have a number of operations that can block when talking to the IMAP
> server, there's the shared imap connection cache, it's all rather ugly.

In general, in Twisted caches should be handled by things like Services.
The simplest Service (which doesn't do caching, but hopefully should show
the way) which does something non-trivial is in twisted/runner/procmon.py

> Initially I was thinking I'd replace the telnet listener with a 
> twisted reactor running in it's own thread - this can then do the
> telnet server (and maybe ssh server). Moving the RADIUS or RTSP 
> listeners to twisted means I'd need to find a way to do the IMAP
> and SMTP (for message sending) in an async manner - I'm not sure
> on the best way to do this.

Well, SMTP is already supported by Twisted (see twisted/protocols/smtp.py).
IMAP isn't...but my inclination would be to drink the whole kool-aid and just
go with async connections instead of threads.

Moshe Zadka -- http://moshez.org/
Buffy: I don't like you hanging out with someone that... short.
Riley: Yeah, a lot of young people nowadays are experimenting with shortness.

More information about the Twisted-Python mailing list