File: myapp_request_handler.tcl

package info (click to toggle)
libapache2-mod-rivet 3.1.1-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 5,716 kB
  • sloc: xml: 8,442; tcl: 7,199; ansic: 6,727; sh: 4,983; makefile: 261; sql: 91; lisp: 78
file content (47 lines) | stat: -rw-r--r-- 901 bytes parent folder | download
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 at the thread initialization
# stage and its content stored in a Tcl_Obj object. This object will
# be evaluated calling Tcl_EvalObjExe
#

::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