Performance and cancel-continuations!

svn: r886
This commit is contained in:
Jay McCarthy 2005-09-20 22:06:33 +00:00
parent c6152b783b
commit 2bf93fa004
3 changed files with 9 additions and 2 deletions

View File

@ -33,6 +33,7 @@
;; kill-connection!: connection -> void ;; kill-connection!: connection -> void
;; kill this connection ;; kill this connection
(define (kill-connection! conn-demned) (define (kill-connection! conn-demned)
(cancel-timer! (connection-timer conn-demned))
(close-output-port (connection-o-port conn-demned)) (close-output-port (connection-o-port conn-demned))
(close-input-port (connection-i-port conn-demned)) (close-input-port (connection-i-port conn-demned))
(set-connection-close?! conn-demned #t) (set-connection-close?! conn-demned #t)

View File

@ -20,6 +20,7 @@
[send/suspend/callback (xexpr/callback? . -> . any)]) [send/suspend/callback (xexpr/callback? . -> . any)])
(provide (provide
clear-continuation-table!
send/suspend/dispatch send/suspend/dispatch
current-servlet-continuation-expiration-handler current-servlet-continuation-expiration-handler
(all-from "servlet-helpers.ss") (all-from "servlet-helpers.ss")
@ -45,6 +46,10 @@
(reset-timer (servlet-instance-timer (get-current-servlet-instance)) (reset-timer (servlet-instance-timer (get-current-servlet-instance))
secs)) secs))
;; ext:clear-continuations! -> void
(define (clear-continuation-table!)
(clear-continuations! (get-current-servlet-instance)))
;; send/back: response -> void ;; send/back: response -> void
;; send a response and don't clear the continuation table ;; send a response and don't clear the continuation table
(define (send/back resp) (define (send/back resp)
@ -55,7 +60,7 @@
;; send/finish: response -> void ;; send/finish: response -> void
;; send a response and clear the continuation table ;; send a response and clear the continuation table
(define (send/finish resp) (define (send/finish resp)
(clear-continuations! (get-current-servlet-instance)) (clear-continuation-table!)
; If we readjust the timeout to something small, the session will expire shortly ; If we readjust the timeout to something small, the session will expire shortly
; we cannot wait for send/back to return, because it doesn't ; we cannot wait for send/back to return, because it doesn't
; Also, we cannot get the initial-connection-timeout variable from here ; Also, we cannot get the initial-connection-timeout variable from here
@ -82,7 +87,7 @@
;; clear the continuation table, then behave like send/suspend ;; clear the continuation table, then behave like send/suspend
(define send/forward (define send/forward
(opt-lambda (response-generator [expiration-handler (current-servlet-continuation-expiration-handler)]) (opt-lambda (response-generator [expiration-handler (current-servlet-continuation-expiration-handler)])
(clear-continuations! (get-current-servlet-instance)) (clear-continuation-table!)
(send/suspend response-generator expiration-handler))) (send/suspend response-generator expiration-handler)))
;; send/suspend/callback : xexpr/callback? -> void ;; send/suspend/callback : xexpr/callback? -> void

View File

@ -3,6 +3,7 @@
(require (lib "list.ss")) (require (lib "list.ss"))
(provide timer? (provide timer?
start-timer reset-timer increment-timer start-timer reset-timer increment-timer
cancel-timer!
start-timer-manager) start-timer-manager)
(define timer-ch (make-channel)) (define timer-ch (make-channel))