[Twisted-Python] untwisting twistd

Phil Christensen phil at bubblehouse.org
Thu Jul 2 09:47:38 MDT 2009


On Jul 2, 2009, at 12:08 AM, Mikhail wrote:
> IMHO there is a misunderstanding here. The point, at least from my  
> POV is
> to have the same functionality provided by twistd but with a different
> interface. Right now twistd is a starter script that is used like:
>
>    twistd -noy -l my.log my_app.tac
>
> As far as I can understand the OP is missing (me as well) the  
> possibility
> to have the same functionality with:
>
>   python my_app.py -noy -l my.log
>
> or
>
>   my_app -noy -l my.log
>
> without writing any kind of wrapping shell/python scripts.

I think this point is well understood, but thank you for clarifying.

> In other words, if we consider example from the book:
[snip snip]
> I'd like to be able to have:
>
> file reverse_app2.py:
>
>    from twisted.application import service
>    import reverse
>
>    application = service.Application("Reverser")
>    reverserService = reverse.ReverserService(()
>    reverserServise.setServiceParent(application)
>
> if __name__ == '__main__':
>    from twisted.SOMETHING import run
>
>    run(...)

So, how is this not a wrapper script? The solution I provided in my  
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.

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

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.

OTOH, I'm quite sure that a patch would be welcomed (hint, hint) ;-)

-phil




More information about the Twisted-Python mailing list