2 * Copyright (c) 2017, Facebook, Inc.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
10 type writer
= Hh_json.json
-> unit
12 type timestamped_json
= {
19 (** must call Daemon.entry_point at start of your main *)
20 val make_t
: unit -> t
22 (** says whether there's already an item on the queue, or stdin is readable meaning that there's something pending on it *)
23 val has_message
: t
-> bool
25 (** similar to [has_message], but can be used to power a 'select' syscall
26 which will fire when a message is available. *)
27 val await_until_message
:
28 t
-> [> `Already_has_message
| `Wait_for_data_here
of Unix.file_descr
]
30 (** says whether the things we've already enqueued from stdin contain a message that matches the predicate *)
31 val find_already_queued_message
:
32 f
:(timestamped_json
-> bool) -> t
-> timestamped_json
option
36 [> `Message
of timestamped_json
37 | `Fatal_exception
of Marshal_tools.remote_exception_data
38 | `Recoverable_exception
of Marshal_tools.remote_exception_data
42 val get_next_request_id
: unit -> int