[racket] #lang web-server

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Fri Mar 16 10:22:58 EDT 2012

Servlets do *not* share the same module instantiations. Each is in a
different unique one. They only shared web-server/http and net/url (so
that structs can communicate between the server and them.) However, if
you use serve/servlet, this is irrelevant because you probably are not
instantiating different servlets anyways.

It is possible to explicitly share any number of modules:

http://docs.racket-lang.org/web-server-internal/dispatch-servlets.html?q=make-servlet-namespace#(mod-path._web-server/configuration/namespace)

and the #:servlet-namespace argument to serve/servlet

As I mentioned above, this is most useful for sharing structs and states.

Jay

On Thu, Mar 15, 2012 at 8:33 PM, Robby Findler
<robby at eecs.northwestern.edu> wrote:
> Another question: do all servlets (in a single running server) share
> the same module instantiations?
>
> I ask because I want to store some data that the user of the web
> server is supplying (on the disk) and I want to be sure that only one
> thread reads and writes the data. So if all servlets share the same
> module instantiations, I'm set. But if they don't, then I'm in
> trouble.
>
> Robby



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

Posted on the users mailing list.