Thread init/recheck IDs to ServerApi
[hiphop-php.git] / hphp / hack / src / stubs / remoteWorker.ml
blobd37429ba24f82820cd2a4d84b5861651c20e37ac
1 (*
2 * Copyright (c) Facebook, Inc. and its affiliates.
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the "hack" directory of this source tree.
7 *)
9 module type RemoteServerApi = sig
10 type naming_table
12 (* Called by the worker to load the naming tabe base when first initializing *)
13 val load_naming_table_base :
14 naming_table_base:Path.t option -> (naming_table, string) result
16 (* Called by the worker to load the naming table before type checking *)
17 val load_naming_table_changes_since_baseline :
18 Provider_context.t ->
19 naming_table:naming_table ->
20 naming_table_diff:Naming_table.changes_since_baseline ->
21 (naming_table, string) result
23 (* Called by the worker to type check a list of files.
24 The state filename is where the type checker should save its state that
25 changed as a result of type checking the files
26 (i.e., the dependency graph) *)
27 val type_check :
28 Provider_context.t ->
29 init_id:string ->
30 check_id:string ->
31 Relative_path.t list ->
32 state_filename:string ->
33 Errors.t
34 end
36 type 'naming_table work_env = {
37 bin_root: Path.t;
38 check_id: string;
39 ctx: Provider_context.t;
40 init_id: string;
41 init_start_t: float;
42 key: string;
43 root: Path.t;
44 naming_table_base: 'naming_table;
45 timeout: int;
46 server: (module RemoteServerApi with type naming_table = 'naming_table);
49 let make_env
50 (ctx : Provider_context.t)
51 ~(bin_root : Path.t)
52 ~(check_id : string)
53 ~(init_id : string)
54 ~(init_start_t : float)
55 ~(key : string)
56 ~(root : Path.t)
57 ?(timeout = (600 : int))
58 (server : (module RemoteServerApi with type naming_table = 'naming_table)) :
59 'naming_table work_env =
61 bin_root;
62 check_id;
63 ctx;
64 init_id;
65 init_start_t;
66 key;
67 naming_table_base = None;
68 root;
69 timeout;
70 server;
73 let go _ = failwith "not implemented"