[Twisted-Python] untwisting twistd

Mikhail termim at gmail.com
Thu Jul 2 18:50:58 EDT 2009


Phil Christensen <phil <at> bubblehouse.org> writes:
> 
> So, how is this not a wrapper script? The solution I provided in my  

Yes, in a sense everything is a wrapper for something. :)

> last email is already workable, doesn't require shell scripting or  
> launching a child process, and doesn't interfere with any of the  
> functionality of the twistd feature. On top of that, it's only a few  
> lines longer than the example you included here.
> 

In my example I should have written 

    run(application)

instead of 

    run(...)

Then the difference would be more apparent. Namely, in my 'wrapper'
it is explicit what application will be run and where all the services
came from, your 'wrapper' is just a customized version of twistd and 
what will be run depends on the command line and what will be found 
in the file system. In some cases I'd like to _explicitly_ code into 
main script what functionality my application provides and I do not
want twistd search file system for plugins at all.

> Perhaps you could point out some things that you *couldn't* do with  
> the example I sent, or other stumbling blocks in using it?
>

I couldn't figure out how to use it without plugins. Obviously I'm 
missing something simple here. If you could extend your example to 
show how to use twistd functionality without writing plugins then it
would be just great.

> At any rate, I don't think there's any disagreement about the fact  
> that it would be nice for the twistd feature to be more flexible in  
> the ways suggested, but it's a non-trivial undertaking.
> 

Yes, that is probably why it is called twisted :)

Mikhail





More information about the Twisted-Python mailing list