[racket] web server: module servlets

From: George Neuner (gneuner2 at comcast.net)
Date: Tue Sep 23 16:42:24 EDT 2014


I'm using 6.0.1 and I have a couple of questions regarding module
servlets.  I'm new to the server side of Racket so please be gentle.

1) Is there any way to speed up initial servlet loading?  Even for a
very simple servlet (does nothing, canned response for testing)
several seconds elapse before it responds to the browser.  I tried
compiling it to bytecode with raco, but having the ./compiled/.zo file
available doesn't seem to make any noticeable difference.  I know the
bytecode still is JIT'd before execution, but I thought eliminating
the source compile step would have helped more.

Does a web server require the .zo file to be in a different location
than ./compiled?  Or does it not deal with bytecode files at all?

2) Debugging module servlets is a pain due to having to stop/restart
the server.  Is there some clever way to force the server to unload a
particular servlet but keep running?

I thought about starting the listener in a thread, but I can't figure
how to get at either the thread or the custodian from within a
servlet.  Would listener termination have to be done from a hardcoded
function at the top level?

Apologies if these questions are stupid.


Posted on the users mailing list.