Module Netcgi_fcgi


module Netcgi_fcgi: sig .. end
FastCGI connector.

Remark: This connector does not allow requests to be multiplexed (and let it know to the web server via FCGI_MPXS_CONNS=0). Multiplexing requests is seldom done by FastCGI modules and is even sometimes impossible because of bugs in them. Moreover, multiplexing is mostly useful if concurrent requests are handled by different threads while this library use a single thread to process all requests coming on a given connection. If the need is felt (speak out!), a multithreaded connector can be built on the side of this one.


class type cgi = object .. end
The usual Netcgi.cgi class with FCGI specific methods.
val run : ?config:Netcgi.config ->
?output_type:Netcgi.output_type ->
?arg_store:Netcgi.arg_store ->
?exn_handler:Netcgi.exn_handler ->
?sockaddr:Unix.sockaddr -> (cgi -> unit) -> unit
run f register the function f as a main function of the script. Each call to the script will execute f cgi. The code outside f will be executed only once (when the script is loaded into memory) which allows to cache database connections, etc.
config : Default: Netcgi.default_config
output_type : Default: `Direct ""
arg_store : Default: `Automatic for all arguments.
exn_handler : See Netcgi.exn_handler. Default: delegate all exceptions to the default handler.

Your application should be ready handle SIGUSR1, used to resquest a "graceful" process shutdown, and SIGTERM to request a quick shutdown.





SourceForge.net Logo