From: Thomas C. <cal...@gm...> - 2013-07-11 14:15:11
|
Hi there, I would like to know if it is possible retrieve configuration parameters from a hook. I get that the variable goes down from the configure and setup functions. However I would like to make the variable accessible from the hook (see example below). Example below: ... let setup srv my_variable = ... (register some rpc) ... my_variable let configure cf addr = let my_variable = try cf # string_param (cf # resolve_parameter addr "my_variable") with | Not_found -> failwith "Required parameter my_variable is missing!" in my_variable ;; let rpc_my_factory = Rpc_netplex.rpc_factory ~configure ~name:"my_rpc" ~setup ~hooks:(fun _ -> object(self) inherit Netplex_kit.empty_processor_hooks() method post_start_hook _ = Do_Something my_variable; (* here *) () end ) () |