durusmail: qp: Twisted - Was: Re: Quixote, QP, the future...?
Twisted - Was: Re: Quixote, QP, the future...?
2006-04-09
2006-04-09
2006-04-10
2006-04-10
2006-04-10
2006-04-10
2006-04-10
2006-04-10
2006-04-10
2006-04-10
2006-04-10
2006-04-12
2006-04-12
2006-04-13
2006-04-13
2006-04-13
2006-04-13
2006-04-14
2006-04-14
2006-04-15
2006-04-16
2006-04-16
Twisted - Was: Re: Quixote, QP, the future...?
David Binger
2006-04-13
On Apr 13, 2006, at 2:08 PM, David K. Hess wrote:

>>
>> The bin/qp tool expects Site.start_web() to start the
>> web and scgi servers.  If I understand it correctly, you
>> want your start_web() to not do that.  I don't think your
>> subclass is satisfying the "contract".
>
> Funny how two people can look at the same thing and have such a
> different point of view! It looks to me like the bin/qp tool
> expects Site.start_web() to "start the qp application" and
> Site.stop_web() to "stop" it. It doesn't look to me like bin/qp
> cares how that's done. Scgi is an implementation detail of
> Site.start_web() not an inherent part of the "contract". At least
> that's how I see it.

Does TwistedSite.start_web() start your application?  I thought it
did not.

>
> The reason I believe my position above is to look at it this way.
> Say I want a single installation of qp to support a Twisted
> application and a default scgi application in two different sites.
> It seems architecturally bad for me to be able to say "qp -s
> twisted_app start" and "tqp -s non_twisted_app start". The choice
> of using Twisted is more than just which web server you want to
> use. The code may inherently require other twisted functionality
> which will break if it isn't coordinated with the reactor.

The Site class as it is now in my tree (with Publisher.run_web())
supports twisted or not,
or any other web server on a per-site basis.  The only thing it does
not support
directly is sites that don't really want run_web() to actually run
the application.

> bin/tqp? I don't have a bin/tqp. Assuming you mean bin/qp, yes,
> "bin/qp -v" does not work correctly yet with a TwistedSite because
> I'm not finished yet. I still need to reimplement Site.status() and
> all the other methods that bin/qp accesses on Site.

By bin/tqp, I mean qp with "from foo import TwistedSite as Site"
instead of
"from qp.lib.site import Site".

>
>> But, the good news is that your "bin/tqp" has the behavior *you*
>> want.
>
> I'm not sure what you mean. I haven't changed any code in bin/qp
> nor created a bin/tqp.

Create bin/tqp as above, and then you'll have just what you want.

reply