[10:00] <albertov> In order to make TG apps fully WSGI compliant some
architectural changes need to take place. Fortunately Paste already
provides most of the building blocks we need (StackedObjectProxy to
handle module globals, wsgi wrappers that make environ look less
daunting, error handling middleware, mechanisms for easy deployment
using a config file, etc..
[10:00] <albertov> To see which bits of TG 1.0 need work on look at the
module globals. At the moment I can think of a few:
[10:00] <albertov> turbogears.database.{metadata,session},
turbogears.config, etc..
[10:01] <albertov> This is because as soon as you have two TG apps in
the same process, those two apps will be looking at the same objects
which is normally not what we want. Fortunately Paste already provides
tools to handle this.
[10:02] <albertov> To sum up, what we/I have in mind for TG 2.0 is:
[10:02] <albertov> 1) Make heavier use of Paste (specially
paste.deploy) to provide the pieces we need to make TG apps easily
deployable in any scenario.
[10:03] <albertov> What we haven't decided yet and is open for
discussion (as everything) is if we shall keep our current config style
(using ConfigObj) along paste.deploy's or stick to paste.deploy only...
[10:03] <albertov> This has a side effect of moving away from the
CherryPy engine which is what we're using currently for config,
dispatching and filtering
[10:04] <albertov> The reason is that, although CP 3 has made a great
progess towards WSGI-friendlyness, it's not yet there IMO.
[10:04] <albertov> For example, CP3 apps cannot be used as opaque WSGI
apps (mainly because of it's use of globals like cherrypy.config,
cherrypy.tree, cherrypy.engine, etc... which where not designed for a
CP app to be a small part of a bigger app..
[10:04] <fumanchu> um
[10:04] <fumanchu> http://www.cherrypy.org/wiki/WSGI
[10:05] <dowski> a_wsgi_app = cherrypy.tree.mount(YourAppRoot())
[10:05] <dowski> if i'm not mistaken
[10:06] <albertov> That last part is important, I'm not saying you
cannot mount several WSGI apps in the same process, being CP or non CP,
but you cannot wrap several CP apps in paste.deploy app_factories and
mount them via URLMapper in a Paste http server
[10:06] <albertov> please correct me if I'm wrong, at leats from my
experiemnts I didn't see an obvious way to avoid clashes between CP's
globals...
[10:06] <eleftherios> albertov, from what I gather TG 2.0 will look
like Pylons quite much. Is this the case?
[10:07] <albertov> eleftherios: that was a secret! shhhhh ;)
[10:07] <dowski> albertov: fumanchu probaly has better info on this,
but each CP3 application has its own config
[10:07] <fumanchu> albertov, that may have been true for CP 2 but
shouldn't be true for CP 3
[10:07] <fumanchu> I'll try to make an example for you
[10:07] * godoy mumbles: now I understand why albertov fell in love
with pylons...
[10:08] <grayrest> are we using other bits of paste? paste.remote and
whatnot?
[10:08] <tazzzzz> eleftherios: the wsgi app construction will be
similar to pylons, but other parts of the stack will likely look
different
[10:08] <godoy> I'd try touching the least things... i.e., keep
ConfigObj and if we need, ditch it in 2.1.
[10:08] <eleftherios> tazzzzz, I see
[10:08] <albertov> I'll need to investigate more then... However, I
might not have made my point clear: a CP app being part of a bigger
WSGI app (not necesarily served by CP) *alonside* other CP apps...
[10:08] <fumanchu> ...is no problem
[10:09] <fumanchu> cf the diagram at the bottom of
http://www.cherrypy.org/wiki/WSGI
[10:09] <albertov> fumanchu: really? how does it prevent smashing
globals?
[10:10] <albertov> however, what I'm saying regarding CP3 is not yet
final.. much discussion needs to take place at the trunk ML. In fact,
my firt experiement monkey-patched cp.config, etc... with
StackedObjectProxies....
[10:10] <fumanchu> we should take this to the ML
[10:11] <albertov> well, I'll continue with my pre-written talk now...
;)
[10:11] <fumanchu> :)
[10:11] <godoy> fumanchu: post it now, as a reminder on the discussion.
we can't miss that point. (I know you won't forget it...)
[10:12] <fumanchu> ok
More discussion to follow. I just spent a man-year of work making CP 3
do all this and more and be beautiful at the same time, and I'll be
damned if I let TG devolve back to preferring the ugliness of bare WSGI
and Paste.
Robert Brewer
System Architect
Amor Ministries
[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---