feature servlet-data added
This commit is contained in:
parent
f9f854ef85
commit
30aca350b9
|
@ -72,6 +72,8 @@
|
|||
(export send/suspend ;send and suspend
|
||||
send/finish ;send and finish
|
||||
send ;just send (no finish, no suspend)
|
||||
set-servlet-data!
|
||||
get-servlet-data
|
||||
))
|
||||
|
||||
(define-interface servlet-handler/admin-interface
|
||||
|
@ -162,7 +164,10 @@
|
|||
|
||||
make-address
|
||||
returned-via?
|
||||
make-callback))
|
||||
make-callback
|
||||
|
||||
set-servlet-data!
|
||||
get-servlet-data))
|
||||
|
||||
(define-structure servlets servlets-interface
|
||||
(open servlet-handler/servlet
|
||||
|
@ -172,6 +177,7 @@
|
|||
parse-html-forms
|
||||
sxml-to-html ; SXML->HTML
|
||||
srfi-1 ; FILTER
|
||||
(subset srfi-13 (string-index))
|
||||
sxml-tree-trans
|
||||
url
|
||||
httpd-request
|
||||
|
|
|
@ -8,13 +8,15 @@
|
|||
(define-record-type instance :instance
|
||||
(make-instance servlet-name memo
|
||||
continuation-table continuation-table-lock
|
||||
continuation-counter)
|
||||
continuation-counter
|
||||
servlet-data)
|
||||
instance?
|
||||
(servlet-name instance-servlet-name)
|
||||
(memo instance-memo set-instance-memo!)
|
||||
(continuation-table instance-continuation-table)
|
||||
(continuation-table-lock instance-continuation-table-lock)
|
||||
(continuation-counter instance-continuation-counter))
|
||||
(continuation-counter instance-continuation-counter)
|
||||
(servlet-data instance-servlet-data set-instance-servlet-data!))
|
||||
|
||||
(define-record memo
|
||||
(message 'kill) ;kill, killed, adjust-timeout
|
||||
|
@ -350,6 +352,19 @@
|
|||
(table-set! continuation-table continuation-id #f))
|
||||
(release-lock continuation-table-lock)))))
|
||||
|
||||
(define (set-servlet-data! new-data)
|
||||
(let ((instance (instance-lookup (session-instance-id))))
|
||||
(if instance
|
||||
(begin
|
||||
(set-instance-servlet-data! instance new-data)
|
||||
#t)
|
||||
#f)))
|
||||
|
||||
(define (get-servlet-data)
|
||||
(let ((instance (instance-lookup (session-instance-id))))
|
||||
(if instance
|
||||
(instance-servlet-data instance)
|
||||
(error "Instance no longer alive."))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ID generation
|
||||
|
|
Loading…
Reference in New Issue