~ubuntu-branches/ubuntu/trusty/ocamlnet/trusty

« back to all changes in this revision

Viewing changes to examples/rpc/sort/sort1_server.ml

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-09-02 14:12:33 UTC
  • mfrom: (18.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110902141233-zbj0ygxb92u6gy4z
Tags: 3.4-1
* New upstream release
  - add a new NetcgiRequire directive to ease dependency management
    (Closes: #637147)
  - remove patches that were applied upstream:
    + Added-missing-shebang-lines-in-example-shell-scripts
    + Try-also-ocamlc-for-POSIX-threads

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(* The main program for the server netplex *)
 
2
 
 
3
let start() =
 
4
  let (opt_list, cmdline_cfg) = Netplex_main.args() in
 
5
 
 
6
  let opt_list =
 
7
    [ "-debug", Arg.String (fun s -> Netlog.Debug.enable_module s),
 
8
      "<module>  Enable debug messages for <module>";
 
9
 
 
10
      "-debug-all", Arg.Unit (fun () -> Netlog.Debug.enable_all()),
 
11
      "  Enable all debug messages";
 
12
 
 
13
      "-debug-list", Arg.Unit (fun () -> 
 
14
                                 List.iter print_endline (Netlog.Debug.names());
 
15
                                 exit 0),
 
16
      "  Show possible modules for -debug, then exit";
 
17
    ] @ opt_list in
 
18
 
 
19
  Arg.parse
 
20
    opt_list
 
21
    (fun s -> raise (Arg.Bad ("Don't know what to do with: " ^ s)))
 
22
    "usage: netplex [options]";
 
23
 
 
24
  let parallelizer = Netplex_mp.mp() in (* multi-processing *)
 
25
  Netplex_main.startup
 
26
    parallelizer
 
27
    Netplex_log.logger_factories   (* allow all built-in logging styles *)
 
28
    Netplex_workload.workload_manager_factories (* ... all ways of workload management *)
 
29
    [ Sort1_worker.worker_factory();
 
30
      Sort1_controller.controller_factory()
 
31
    ]
 
32
    cmdline_cfg
 
33
 
 
34
 
 
35
let () =
 
36
  Netsys_signal.init();
 
37
  start()