File: myapp_request_handler.tcl

package info (click to toggle)
libapache2-mod-rivet 3.2.6-1
  • links: PTS
  • area: main
  • in suites: forky, trixie
  • size: 6,384 kB
  • sloc: tcl: 8,982; xml: 8,619; ansic: 7,074; sh: 5,039; makefile: 195; sql: 91; lisp: 78
file content (47 lines) | stat: -rw-r--r-- 911 bytes parent folder | download | duplicates (4)
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
40
41
42
43
44
45
46
47
# -- myapp_request_handler.tcl
#
# This script will be read by mod_rivet during the process/thread 
# initialization stage and its content stored in a Tcl_Obj object. 
# This object is evaluated internally by mod_rivet
#

::try {

    ::theApplication request_processing [::rivet::var_qs all]

} trap {RIVET ABORTPAGE} {err opts} {

     set abort_code [::rivet::abort_code]

    switch $abort_code {
       code1 {
           # handling abort_page with code1
           ....
       }
       code2 {
           # handling abort_page with code2
          ....      
       }
       # ...
       default {
           # default abort handler
       }
   }

} trap {RIVET THREAD_EXIT} {err opts} {
    
    # myApplication sudden exit handler
    ...

} on error {err opts} {

    # myApplication error handler
    ...

} finally {

    # request processing final elaboration
    
}

# -- myapp_request_handler.tcl