module Main:sig..end
typejson =Json.t
typekind =[ `EXEC | `GET | `SET ]
val string_of_kind : kind -> string
val pp_kind : Format.formatter -> kind -> unitval register : kind -> string -> (json -> json) -> unit
val find : string -> (kind * (json -> json)) option
val exec : string -> json -> jsontype signal
val signal : string -> signaltype'arequest =[ `Kill of 'a
| `Poll
| `Request of 'a * string * json
| `Shutdown
| `SigOff of string
| `SigOn of string ]
type'aresponse =[ `Data of 'a * json
| `Error of 'a * string
| `Killed of 'a
| `Rejected of 'a
| `Signal of string ]
type 'a message = {
|
requests : |
|
callback : |
type 'a server
val create : pretty:(Format.formatter -> 'a -> unit) ->
?equal:('a -> 'a -> bool) ->
fetch:(unit -> 'a message option) -> unit -> 'a server~logs:false is specified.
Default equality is the standard `(=)` one.
val run : 'a server -> unitval start : 'a server -> unit
The function returns immediately after installing a daemon that accepts GET
requests received by the server on calls to Db.yield().
val stop : 'a server -> unitval kill : unit -> 'aval emit : signal -> unitval on_signal : signal -> (bool -> unit) -> unit
The callback is invoked with true on SIGON command
and false on SIGOFF.
val on : (bool -> unit) -> unit