sig
type json = Json.t
type kind = [ `EXEC | `GET | `SET ]
val string_of_kind : Server.Main.kind -> string
val pp_kind : Stdlib.Format.formatter -> Server.Main.kind -> unit
val register :
Server.Main.kind ->
string -> (Server.Main.json -> Server.Main.json) -> unit
val find :
string ->
(Server.Main.kind * (Server.Main.json -> Server.Main.json)) option
val exec : string -> Server.Main.json -> Server.Main.json
type signal
val signal : string -> Server.Main.signal
val signal_name : Server.Main.signal -> string
type 'a request =
[ `Kill of 'a
| `Poll
| `Request of 'a * string * Server.Main.json
| `Shutdown
| `SigOff of string
| `SigOn of string ]
type 'a response =
[ `CmdLineOff
| `CmdLineOn
| `Data of 'a * Server.Main.json
| `Error of 'a * string
| `Killed of 'a
| `Rejected of 'a
| `Signal of string ]
type 'a message = {
requests : 'a Server.Main.request list;
callback : 'a Server.Main.response list -> unit;
}
type 'a server
val create :
pretty:(Stdlib.Format.formatter -> 'a -> unit) ->
?equal:('a -> 'a -> bool) ->
fetch:(unit -> 'a Server.Main.message option) ->
unit -> 'a Server.Main.server
val start : 'a Server.Main.server -> unit
val stop : 'a Server.Main.server -> unit
val run : 'a Server.Main.server -> unit
val kill : unit -> 'a
val emit : Server.Main.signal -> unit
val on_signal : Server.Main.signal -> (bool -> unit) -> unit
val on : (bool -> unit) -> unit
end