[racket] #lang web-server

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Fri Mar 16 10:29:38 EDT 2012

Wait: I don't understand. I do 'racket main.rkt'. That file contains a
call to serve/servlet (with #:stateless? #t) and passes a function
'start' that gets called with requests. I think that maybe what you're
saying below is that what I'm doing is not "servlets" and what happens
is just what I would expect: there is no fancy monkey business with
namespaces (unless my code does it).

Is that right?


On Fri, Mar 16, 2012 at 9:22 AM, Jay McCarthy <jay.mccarthy at gmail.com> wrote:
> 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.