[racket] simple http server without stateful/stateless continuations stuff

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Tue Jul 8 21:53:12 EDT 2014

Thanks, Jay.  I am taking another look.

BTW, the intro to the "web-server-internal" document I saw says only 
that it's documenting the internals, and the module paths have 
"private/" in them.  If in a future version of Racket, it's clarified 
that this is reusable API, and the "private/" is removed from the module 
paths, will the old module paths also still work, for 
backward-compatibility?

Neil V.


Jay McCarthy wrote at 07/05/2014 09:28 AM:
> Yes.
>
> If you use "serve/servlet" and never call any "send/*" function except
> "send/back", then you won't get any continuation handling. You can
> also pass web-server/managers/none as #:manager and any attempt to use
> continuations will error. If you want to write your own
> headers/content yourself, then you could use a raw "response"
> structure.
>
> Another thing you can do is use serve/launch/wait and just give a
> dispatcher that uses web-server/dispatchers/dispatch-lift or even just
> grabs connection-o-port itself and writes raw.
>
> That documentation, btw, is not private internals. It's designed for
> people to write their own custom Web servers.
>
> Jay
>
> On Fri, Jul 4, 2014 at 7:25 PM, Neil Van Dyke <neil at neilvandyke.org> wrote:
>> In Racket 5.3.4, is there a way to use the barebones HTTP-serving
>> functionality of the Racket Web Server code, without getting any of the
>> ``Stateful'' or ``Stateless'' stuff, nor any trickiness that it does with
>> the callback code to support the continuations?
>>
>> I just want each request to result in a callback in a new thread that lets
>> me get header values and read POST data, and then write the response headers
>> and content to a port.)
>>
>> I see the documentation in
>> "http://docs.racket-lang.org/web-server-internal/dispatch-server-unit.html",
>> which looks like it might have things I can use (unclear), but it appears to
>> be some documentation on private internals, not public API.
>>
>> (This is for some unit testing of clients for various webservices, in which
>> I need to emulate the interfaces of the webservices, and to have the tests
>> be able to see both client and server sides.  For this purpose, I really
>> don't want the "web-server" trickiness with the code, and I need a public
>> API.)
>>
>> Neil V.
>>
>> ____________________
>>   Racket Users list:
>>   http://lists.racket-lang.org/users
>
>


Posted on the users mailing list.