[plt-scheme] plt web-server: adjust-timeout! ?

From: Hans Oesterholt-Dijkema (hdnews at gawab.com)
Date: Fri Jun 29 08:15:17 EDT 2007

Hmm, This is what happens when I call a servlet with
images in it. The Last revise-timer is that of an image
loaded by the web server *static *content part.
So even a reference to CSS will be a problem.

So whatever timeout I set. It will allways be overridden
with some other value.

Is this a problem in the 360 web-server code?

--Hans


adjust-timeout! 15 600
revise-timer: 2: id=46, secs=86429980.0
revise-timer: 2: id=46, secs=600000
revise-timer: 2: id=46, secs=86429980.0
timer-loop: 366
revise-timer: 2: id=46, secs=600000
timer-loop: 367
htmllink:page special:logout 
(/servlets;15*1*92444916/hwiki.scm/index.html)  .html
htmllink:page special:edit 
(/servlets;15*1*92444916/hwiki.scm/index.html)  .html
htmllink:page special:upload 
(/servlets;15*1*92444916/hwiki.scm/index.html)  .html
htmllink:page special:template 
(/servlets;15*1*92444916/hwiki.scm/index.html)  .html
htmllink:page special:prefs 
(/servlets;15*1*92444916/hwiki.scm/index.html)  .html
htmllink:page special:admin 
(/servlets;15*1*92444916/hwiki.scm/index.html)  .html
revise-timer: 2: id=8, secs=30000
revise-timer: 2: id=8, secs=3912000
revise-timer: 2: id=8, secs=30000
timer-loop: 368
revise-timer: 2: id=8, secs=3912000
timer-loop: 369
revise-timer: 2: id=35, secs=30000
revise-timer: 2: id=35, secs=34785000
revise-timer: 2: id=35, secs=30000
timer-loop: 370
revise-timer: 2: id=35, secs=34785000
timer-loop: 371


Hans Oesterholt-Dijkema schreef:
> However, I still don't get the results I'd like to see.
> Given the add.scm below, I see following behaviour in my debug log:
>
> Welcome to MzScheme version 360, Copyright (c) 2004-2006 PLT Schem
> > (require (planet "hwiki.scm" ("oesterholt" "hwiki.plt" 1 0)))
> > (hwiki)
> Warning: No rewrite rules defined.
> Servlet will be available through '/servlets/hwiki.scm/<page.html>
>
> PostgreSQL connectionstring: host=pegasus dbname=test user=hans
> copy-to: C:\Documents and Settings\hdijkema\Application Data\PLT S
> wiki.scm
> Web server started on port 80
> Visit URL http://localhost:80/servlets/hwiki.scm
> Type stop to stop the server and exit
> Type restart to restart the server
> add-timer: ID=1 30000
> revise-timer!: ID=1 30000
> revise-timer!: ID=1 86400000
> add-timer: ID=2 86400000
> revise-timer!: ID=2 172800000.0
> revise-timer!: ID=2 172800000.0
> *1
> adjust-timeout! 1 180
> **add-timer: ID=3 30000
> revise-timer!: ID=3 259200000.0
> revise-timer!: ID=3 180000
> ALARM: id=3
>
> /This is after 30 seconds, not after 180!/
>
> *add-timer: ID=4 0
> ALARM: id=4
> revise-timer!: ID=4 30000
> revise-timer!: ID=4 86400000
> revise-timer!: ID=4 86547143.0
> revise-timer!: ID=4 172947143.0
> revise-timer!: ID=4 172947143.0
> revise-timer!: ID=4 27146.0
> revise-timer!: ID=4 259347143.0
>
> (require (lib "unitsig.ss")
>          (lib "servlet-sig.ss" "web-server")
>          (lib "date.ss"))
>
> (unit/sig () (import servlet^)
>
>   ; request-number : str -> num
>   (define (request-number which-number)
>     (string->number
>      (extract-binding/single
>       'number
>       (request-bindings (send/suspend (build-request-page 
> which-number))))))
>
>   ; build-request-page : str -> str -> response
>   (define (build-request-page which-number)
>     (lambda (k-url)
>        (adjust-timeout! 180)
>       `(html (head (title "Enter a Number to Add"))
>              (body ([bgcolor "white"])
>                    (form ([action ,k-url] [method "post"])
>                          "Enter the " ,which-number " number to add: "
>                          (input ([type "text"] [name "number"] [value 
> ""]))
>                          (input ([type "submit"] [name "enter"] [value 
> "Enter"])))))))
>
>
>   `(html (head (title "Sum"))
>          (body ([bgcolor "white"])
>                (p "The sum is "
>                   ,(number->string (+ (request-number "first") 
> (request-number "second")))))))
>
>
>
> Matt Jadud schreef:
>> I usually find that I answer most of my questions after asking them on
>> the list. It's good to see others using the list for the same
>> purpose... asking a question, answering it themselves, and then having
>> the same forehead-slapping revelations that I do... :D
>>
>> Cheers,
>> M
>>
>> On 6/29/07, Hans Oesterholt-Dijkema <hdnews at gawab.com> wrote:
>>>
>>>  I'm such a birdbrain,
>>>  adjust-timeout! has to be in the function given to send/supend of 
>>> course!
>>>  Thanks anyway!
>>
>>
> ------------------------------------------------------------------------
>
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20070629/e503ebf9/attachment.html>

Posted on the users mailing list.