Profilability

This commit is contained in:
Tony Garnock-Jones 2012-05-25 18:42:57 +01:00
parent e2f9e30b58
commit 97ff546a73
2 changed files with 10 additions and 1 deletions

View File

@ -60,5 +60,8 @@ veryclean: clean thirdpartyclean
$(APP).native: $(wildcard *.ml)
ocamlbuild -use-ocamlfind -X thirdparty -X scratch $@
$(APP).p.native: $(wildcard *.ml)
ocamlbuild -use-ocamlfind -X thirdparty -X scratch $@
run: all
./$(APP).native

View File

@ -35,6 +35,11 @@ let create_ready_file () =
| None ->
return ()
let console_watcher () =
lwt _ = Lwt_io.read_line Lwt_io.stdin in
Server_control.milestone "Shutdown requested";
return ()
lwt _ =
Printf.printf "%s %s, %s\n%s\n%!"
App_info.product App_info.version App_info.copyright App_info.licence_blurb;
@ -54,8 +59,9 @@ lwt _ =
lwt () = Server_control.run_until "AMQP ready" in
lwt () = Server_control.run_until "HTTP ready" in
lwt () = Server_control.run_until "Hop ready" in
ignore (console_watcher ());
if Server_control.is_running ()
then (lwt () = create_ready_file () in
Server_control.milestone "Server initialized";
Server_control.run_forever ())
Server_control.run_until "Shutdown requested")
else return ()