File: manager.rkt

package info (click to toggle)
racket 6.7-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 97,344 kB
  • ctags: 39,484
  • sloc: ansic: 277,847; sh: 33,512; asm: 13,558; lisp: 7,113; cpp: 2,872; makefile: 2,421; pascal: 2,262; exp: 499; python: 274; xml: 11
file content (39 lines) | stat: -rw-r--r-- 1,681 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#lang racket/base
(require racket/contract
         web-server/http/request-structs
         web-server/servlet/servlet-structs)

(define-struct manager (create-instance 
                        adjust-timeout!
                        clear-continuations!
                        continuation-store!
                        continuation-lookup
                        continuation-peek))

(define-struct (exn:fail:servlet-manager:no-instance exn:fail) (expiration-handler))
(define-struct (exn:fail:servlet-manager:no-continuation exn:fail) (expiration-handler))

(provide/contract
 [struct manager ([create-instance ((-> void) . -> . number?)]
                  [adjust-timeout! (number? number? . -> . void)]
                  [clear-continuations! (number? . -> . void)]
                  [continuation-store! 
                   (->
                    number? any/c 
                    (or/c false/c
                          (request? . -> . can-be-response?))
                    (list/c number? number?))]
                  [continuation-lookup (number? number? number? . -> . any/c)]
                  [continuation-peek (number? number? number? . -> . any/c)])]
 [struct (exn:fail:servlet-manager:no-instance exn:fail) 
         ([message string?]
          [continuation-marks continuation-mark-set?]
          [expiration-handler 
           (or/c false/c
                 (request? . -> . can-be-response?))])]
 [struct (exn:fail:servlet-manager:no-continuation exn:fail)
         ([message string?]
          [continuation-marks continuation-mark-set?]
          [expiration-handler 
           (or/c false/c
                 (request? . -> . can-be-response?))])])