We should nail down a concise list of goals. Here's my first draft:
* autostart applications
* skip applications that are refusing new sessions
* load balancing
* support a variety of adapters (CGI, ISAPI, NSAPI, ...)
We need to keep in mind that the adaptor won't always be a CGI adaptor and
even more importantly, won't always be in Python. I can imagine a CGI
adaptor written in pure C to eliminate the overhead of loading the Python
interpreter each time. I can also imagine C adaptors written in
server-specific APIs such as NSAPI and ISAPI.
That having been said, I can picture two scenarios:
1. We write an adapter.c file, in C (obviously), that contains the
necessary data structures and functions required by other adapters (CGI,
NSAPI, ISAPI, etc.). Functionality here does things like autostarting
instances, skipping application instances that are refusing new
connections, load balancing, etc. The actual adapters will have few lines
of source code, as they'll just be using functions from this.
2. We write Dispatcher.py which is a process that sits between the adapter
and does the above. Adapters remain very lightweight and just forward their
requests to the Dispatcher.py which has most of the logic. The advantage
here is getting to write more of our code in Python rather than C.
For performance reasons, I prefer 1. It has one less process than 2 and by
using C, keeps the adapter overhead as lightweight as possible.
In any case, Geoff, if we remove the address files per Jay's suggestion of
encoding the address in _sid_, what would you new pseudo logic look like now?
Also, could you attach as a text file instead? Somewhere along the way,
whitespace problems and word wrapping, chewed up your pseudo-code into
something very hard to read.
Do the goals look good? What about the approaches?