[Twisted-Python] Hep and Twisted (Was: Twisted-webserver hangs when serving big files)

Abe Fettig abe at fettig.net
Tue Jun 10 01:54:43 EDT 2003

On Mon, 2003-06-09 at 14:32, Moshe Zadka wrote:
> On 09 Jun 2003, Abe Fettig <abe at fettig.net> wrote:
> > * The application: Hep should be a .tap-able twisted plugin.  At the
> > moment it's not.  This is assuming that it's possible to create a plugin
> > that combines multiple kinds of servers (http, pop3, imap, etc) into a
> > single application.  Also I believe that if I was using a twisted
> > Application object there would be some kind of official Twisted way to
> > share objects between my different servers.  It's been a while since I
> > read the plugin docs.  I'll do so soon.
> The bottom line: it should be dead easy. I recommend also reading
> the "application" document. Also, there's no documentation for
> ApplicationService, but there are lots of time where ApplicationServices
> are the correct way to share information between services. The source
> (and the API reference) is the best documentation here. Of course,
> as always, more documentation would be appreciated.

I just spent some time looking playing with t.i.app. If I understand it
correctly, you run a bunch of services, each of which provides certain
functionality, and all of the services get registered with the
application.  So each service can access any of the other services like

otherService = self.serviceParent.getServiceByName('otherService')

This is a really natural fit for Hep and looks easy as pie to
implement.  One question, though.  Say I run a server by creating a
Factory and running application.listenTCP(myFactory, port).  What's the
preferred way to access services from inside that Factory?

> twisted.mail is also going a rewrite, so I'd wait for Jp to comment.

Ok, I'll wait for Jp :)

> Note that again, ApplicationService may be a nice thing here, especially
> if it's data that you *could* recover from the messages themselves on
> startup. Otherwise, it is better to look into some safer persistence
> strategy such as dirdbm or world (although world is fairly unstable).
> Bottom line: put configuration data in the Application, share configuration
> between multiple servers via ApplicationServices, put non-critical data
> in ApplicationServices and critical data in safer formats like databases.

The only variable that I think I'd want to maintain in the Application
is the location of it's data directory.  That way when the app starts it
knows where to look to find messages, user prefs, etc, and I can ditch
the hep.ini file.


More information about the Twisted-Python mailing list