Fix special case of alternate if statements
[hiphop-php.git] / hphp / hack / src / server / clientProvider_sig.ml
bloba4dd0e75ef78b75dc34aa4f39063779a7d24abc1
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 module type S = sig
11 type t
12 type client
14 exception Client_went_away
16 val provider_from_file_descriptor : Unix.file_descr -> t
17 val provider_for_test : unit -> t
19 val sleep_and_check : t ->
20 (** Optional persistent client. *)
21 client option ->
22 (* Whether the most recent message received from persistent client
23 * was IDE_IDLE *)
24 ide_idle:bool ->
25 (** Returns an optional new client, and a boolean for whether there is
26 * a request on the persistent client. *)
27 client option * bool
28 val accept_client : t -> client
29 val read_connection_type : client -> ServerCommandTypes.connection_type
30 val send_response_to_client : client -> 'a -> float -> unit
31 val send_push_message_to_client : client -> ServerCommandTypes.push -> unit
32 val client_has_message: client -> bool
33 val read_client_msg: client -> 'a ServerCommandTypes.command
34 val make_persistent : client -> client
35 val is_persistent : client -> bool
36 val shutdown_client: client -> unit
37 val ping: client -> unit
39 (* TODO: temporary way to break the module abstraction. Remove after
40 * converting all the callsites to use methods on this module instead of
41 * directly using channels. *)
42 val get_channels: client -> Timeout.in_channel * out_channel
43 end