| 1 | (************************************************************************) |
| 2 | (* * The Rocq Prover / The Rocq Development Team *) |
| 3 | (* v * Copyright INRIA, CNRS and contributors *) |
| 4 | (* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 | (* \VV/ **************************************************************) |
| 6 | (* // * This file is distributed under the terms of the *) |
| 7 | (* * GNU Lesser General Public License Version 2.1 *) |
| 8 | (* * (see LICENSE file for the text of the license) *) |
| 9 | (************************************************************************) |
| 10 | |
| 11 | (* High level api for clients of the service (like coqtop) *) |
| 12 | |
| 13 | type priority = Low | High |
| 14 | val string_of_priority : priority -> string |
| 15 | val priority_of_string : string -> priority |
| 16 | |
| 17 | (* Default priority *) |
| 18 | val default_async_proofs_worker_priority : priority |
| 19 | |
| 20 | (* Connects to a work manager if any. If no worker manager, then |
| 21 | -async-proofs-j and -async-proofs-tac-j are used *) |
| 22 | val init : priority -> unit |
| 23 | |
| 24 | (* blocking *) |
| 25 | val get : int -> int |
| 26 | |
| 27 | (* not blocking *) |
| 28 | val tryget : int -> int option |
| 29 | val giveback : int -> unit |
| 30 | |
| 31 | (* Low level *) |
| 32 | type request = |
| 33 | | Hello of priority |
| 34 | | Get of int |
| 35 | | TryGet of int |
| 36 | | GiveBack of int |
| 37 | | Ping |
| 38 | |
| 39 | type response = |
| 40 | | Tokens of int |
| 41 | | Noluck |
| 42 | | Pong of int * int * int (* cur, max, pid *) |
| 43 | |
| 44 | val connect : string -> Unix.file_descr option |
| 45 | |
| 46 | exception ParseError |
| 47 | |
| 48 | (* Intended to be used with input_line and output_string *) |
| 49 | val parse_request : string -> request |
| 50 | val parse_response : string -> response |
| 51 | |
| 52 | val print_request : request -> string |
| 53 | val print_response : response -> string |