So I said, narrow the focus.
Your "use case" should be, there's a 22 year old college student
living in the dorms.
How will this software get him laid? - jwz
A neat thing we’ve just done in the dev team is to replace our cgi based multi-repo server setup with a single python server.
We have lots of forks of WooMe’s codebase (all stored in mercurial) and each one needs to be served so we (the team) can see it and discuss it and suggest changes and so on and also so the selenium based QA can see it and run regression tests against it.
Previously we had a cgi setup. Each instance is in a single directory and we use some lighty magic to fire the requests at a CGI instance.
The trouble is, we also had to use a FUSE filesystem to ensure that the underscore character in a repository name was translated into a hyphen (underscore isn’t a legal character for DNS names).
This has worked really well. But it’s a bit slow. This is mostly the fault of the FUSE fileystem. FUSE is difficult to get right unfortuately.
It occurred to me a few weeks ago that the FUSE and the CGI could be replaced by something that understood how to dispatch to WSGI directly. Since all our instances are very consistent and always start up the same way (since they’re all just forks of the same code base) we could have a python server that imported the code from the right place and just pushed the request into it.
There was only one catch, we had to ensure that each request was served in it’s own process so that one python tree didn’t trampel over another. This is easily achieved with wsgiref however.
Check the code out at our github