Hi,
I have made a first round through Hunchentoot with the goals being:
- Remove system specific code, relying on common compatibility libraries instead - Make single threaded operation a run-time option - Add timeout support for more platforms - Factor out SSL specific code so that conditional code is reduced - Remove mod_lisp support to ease refactoring and simplify the code
I met most of these goals:
- Instead of using functions from port-*.lisp, Hunchentoot now depends on bordeaux-threads for multiple thread support and on usocket for socket i/o. The GET-BACKTRACE function still remains as being non-portable.
- Threading behavior is now controller by a CONNECTION-MANAGER. Every SERVER object has one CONNECTION-MANAGER and delegates listening and connection processing to that instance. Currently, there exist two CONNECTION-MANAGER classes: SINGLE-THREADED-CONNECTION-MANAGER listens and processes connections synchronously, ONE-THREAD-PER-CONNECTION-MANAGER listens in a separate thread and processes each connection in a new thread, as Hunchentoot did on multi-threaded platforms until now. The API for START-SERVER supports a THREADED keyword argument for simplicity, but it may be desirable to implement other CONNECTION-MANAGER classes in the future (for example to pool threads and/or separate connection management from request execution).
Timeouts which are really an issue that is hard to solve, as there is no cross-implementation agreement on what timeouts are and how they should be implemented. As I need to make progress, I have added a platform specific SET-TIMEOUTS function which uses whatever mechanism the Lisp platform offers. I have removed the setting for separate read and write timeouts as I don't think that it is really useful make the distinction, but if someone has a really good use case, I may be adding them.
I am currently testing my changes on more platforms and compilers. CCL and SBCL work fine, Lispworks is under investigation, I'll also look at CLISP later on. If there are other platforms that you'd like to see supported in the future, please check out the branch and send me patches.
Branch SVN URL:
http://common-lisp.net/project/tbnl/svn/branches/hans
Trac URL for browsing:
http://trac.common-lisp.net/tbnl/browser/branches/hans
RSS URL for commits:
http://trac.common-lisp.net/tbnl/timeline?changeset=on&max=50&daysba...