Page
Library
Module
Module type
Parameter
Class
Class type
Source
Jsonrpc.Servertype reply = (json, int * string) Result.resultthe return value of an JSON-RPC function
module Error : sig ... endval create : unit -> tcreate a JSON-RPC server; the default function will be set to (fun _ -> Error.method_not_found), returning this error message as reply to all requests.
add_cb srv ~name cb add the callback function cb to the server src. The function will be called in a JSON-RPC request matches the given function name name.
set_default src cb sets the default callback function to cb in the server srv. This function is called if no callback function matches the function name in the RPC reuqest.
val remove_cb : name:string -> t -> unitremove_cb ~name srv removes the callback function for name name from the server srv.
evalj srv json_in generates a return value for the given JSON-RPC request json_in for the server srv. If no answer is to be sent back to the caller, this function will return None.
val eval : t -> string -> string optioneval srv s works just like evalj srv json but will parse the value s to JSON; it also converts the reply to a string value to be sent back to the caller.