Hello,
I've added a new keyword argument :MODE to START-SERVER that can be one of :THREADED or :SERVE-EVENT and implemented serve-event support for SBCL and CLISP. This is a preliminary patch. No real-world testing or documentation yet. It might however already be useful for people doing development on, e.g., SBCL/OSX.
In CLISP's case, you have to run (hunchentoot:clisp-serve-events) to for the server(s) to actually run and handle requests. By the way, should anyone deploy a server using serve-event, make sure to run it behind a reverse proxy such as Apache's mod_proxy or Pound otherwise a client with a slow connection will stall all the other clients.
Also, regarding CLISP, it complains about WRITE-SEQUENCEing a sequence of (unsigned-byte 8) to a flexi-stream with a character element-type. See the START-OUTPUT function in headers.lisp towards the end. Not sure if that was the best fix or whether it should be conditionalized for CLISP.
Comments welcome.
Hello,
I've added a new keyword argument :MODE to START-SERVER that can be one of :THREADED or :SERVE-EVENT and implemented serve-event support for SBCL and CLISP. This is a preliminary patch. No real-world testing or documentation yet. It might however already be useful for people doing development on, e.g., SBCL/OSX.
In CLISP's case, you have to run (hunchentoot:clisp-serve-events) to for the server(s) to actually run and handle requests. By the way, should anyone deploy a server using serve-event, make sure to run it behind a reverse proxy such as Apache's mod_proxy or Pound otherwise a client with a slow connection will stall all the other clients.
Also, regarding CLISP, it complains about WRITE-SEQUENCEing a sequence of (unsigned-byte 8) to a flexi-stream with a character element-type. See the START-OUTPUT function in headers.lisp towards the end. Not sure if that was the best fix or whether it should be conditionalized for CLISP.
Patch URL: http://common-lisp.net/~loliveira/patches/serve-event.diff
Comments welcome.
-- Luís Oliveira http://student.dei.uc.pt/~lmoliv/
PS -- This is a resend as my previous message got stuck somewhere. Sorry if it becomes a duplicate.
Hi,
On Sun, 19 Nov 2006 21:25:26 +0000, "Luís Oliveira" luismbo@gmail.com wrote:
I've added a new keyword argument :MODE to START-SERVER that can be one of :THREADED or :SERVE-EVENT and implemented serve-event support for SBCL and CLISP. This is a preliminary patch. No real-world testing or documentation yet. It might however already be useful for people doing development on, e.g., SBCL/OSX.
Nice. Don't hesitate to send a patch once you think it's mature enough. (A "real" patch should of course also include the necessary documentation... :)
Also, regarding CLISP, it complains about WRITE-SEQUENCEing a sequence of (unsigned-byte 8) to a flexi-stream with a character element-type. See the START-OUTPUT function in headers.lisp towards the end. Not sure if that was the best fix or whether it should be conditionalized for CLISP.
Do you have the latest version of FLEXI-STREAMS? I thought the CLISP issues were gone, but I don't use CLISP, so I'm not sure.
Cheers, Edi.
On 11/20/06, Edi Weitz edi@agharta.de wrote:
Do you have the latest version of FLEXI-STREAMS? I thought the CLISP issues were gone, but I don't use CLISP, so I'm not sure.
Yes I do. Hmm, are you supposed to be able to write a sequence of octets onto a flexi-stream with element-type character? I can't tell from the documentation, though it apparently it works on most Lisps but CLISP. If so, what exactly is the element-type for?
[Cc to flexi-streams-devel]
On Mon, 20 Nov 2006 21:50:16 +0000, "Luís Oliveira" luismbo@gmail.com wrote:
Hmm, are you supposed to be able to write a sequence of octets onto a flexi-stream with element-type character? I can't tell from the documentation, though it apparently it works on most Lisps but CLISP. If so, what exactly is the element-type for?
Several Lisps have "bivalent" streams where you can write octets as well as characters to the same stream regardless of its element type. (I'd say that in this case the element type is just some kind of "hint" provided by the person who sets it.) If I were to decide, flexi streams would also be bivalent - FLEXI-STREAMS is flexible enough to support that (note the superclasses of FLEXI-INPUT-STREAM, for example), but apparently CLISP isn't.
I'm not sure if anything in the ANSI spec (or in the Gray streams specification) explicitely forbids bivalent streams. If that's the case, at least LispWorks, AllegroCL, and SBCL are non-confirming, but I like their behaviour. My personal opinion is that CLISP's Gray stream implementation is simply suboptimal.