solved some TODOs about Tgeneric type arguments (2)
[hiphop-php.git] / hphp / hack / src / monitor / informant_sig.ml
bloba52441c0406179066f6a70832b337f1936625a31
1 (*
2 * Copyright (c) 2016, Facebook, Inc.
3 * All rights reserved.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
8 *)
10 type report =
11 (* Nothing to see here. *)
12 | Move_along
13 (* Kill the server (if one is running) and start a new one. *)
14 | Restart_server of ServerMonitorUtils.target_saved_state option
16 type server_state =
17 | Server_not_yet_started
18 | Server_alive
19 | Server_dead
21 (** The informant collects information to tell the monitor when to
22 * intelligently kill and restart the server daemon.
24 * For example: An informant may want to watch the repo state and tell
25 * the monitor to restart the server when a significant change in
26 * repo revision occurs since a fresh initialization could be faster
27 * than an incremental type check. *)
28 module type S = sig
29 type t
31 type init_env
33 val init : init_env -> t
35 (* Same as init, except it preserves internal Revision_map cache.
36 * This is used when server decides to restart itself due to rebase - we don't
37 * want Informant to then restart the server again. Reinitializing will discard
38 * the pending queue of state changes, and issue new query for base revision,
39 * in order to "synchronize" base revision understanding between server and
40 * monitor. *)
41 val reinit : t -> unit
43 val report : t -> server_state -> report
46 * Returns true if the informant is actually running and will
47 * manage server lifetime.
49 val is_managing : t -> bool
51 val should_start_first_server : t -> bool
53 val should_ignore_hh_version : init_env -> bool
54 end