[Twisted-Python] Is it just me ....

Neil Blakey-Milner nbm at mithrandr.moria.org
Thu Jul 10 06:24:02 MDT 2003


On Thu 2003-07-10 (12:00), Moshe Zadka wrote:
> Well, if you have two services that rely on each other, a nice way to
> deal with that is MultiService. Have a convenicence function which
> returns a MultiService, all loaded up with both services, created
> from arguments to this function.
...

> Or, you might want to support an even more extreme method of hiding
> implementation details from users:

...

> Another thing you can do when you convert to a package [and you should,
> regardless!] is to supply tap plugins that would look like

...

> Other remarks:
> 
> * startScheduler should be called from startService, not __init__, to
>   support persistence
> * similarily, all reactor.callLater() results should be saved from
>   an attribute of the SyndicationService, which is then .cancelled()
>   in stopService
> * 9119 is a hardcoded number. Probably should be given in an argument
>   to news service. Of course, the above get...Service() calls should
>   be modified to accept that argument, blah blah blah.
> * I'd prefer it if .listenTCP was not called from __init__, but instead,
>   an easy way to get the right factory was supplied:

...

> Rationale: easier support for non-common listening options [what if you
> want to only listen on 127.0.0.1, so that only you can read the news?
> what if you wanted to listen on several ports to defeat firewalls?]
> 
> I hope that matches your expectations of how thoroughly we can pick
> on you :)

More, more!

Thanks for the critique - I'll try apply this as I'm able to and get
back to everyone once I have an updated version.  I'll also see about
codifying your suggestions and having a before-and-after type document
with real examples.

(Offer time-permittingly open to others if they critique or suggest
stuff that's generally considered good advice.)

Thanks,

Neil
-- 
Neil Blakey-Milner
nbm at mithrandr.moria.org




More information about the Twisted-Python mailing list