Module Jsonrpc2_sync
Blocking API for jsonrpc2
include sig ... end
type json
= Jsonrpc2__.Jsonrpc2_intf.J.t
type t
= Jsonrpc2__Jsonrpc2_core.Make(IO_sync).t
val create : ic:IO.in_channel -> oc:IO.out_channel -> unit -> t
type method_
= t -> params:json option -> return:((json, string) Pervasives.result -> unit) -> unit
val declare_method : t -> string -> method_ -> unit
val declare_method_with : t -> decode_arg:(json -> ('a, string) Pervasives.result) -> encode_res:('b -> json) -> string -> (t -> params:'a option -> return:('b -> unit) -> unit) -> unit
val declare_blocking_method_with : t -> decode_arg:(json -> ('a, string) Pervasives.result) -> encode_res:('b -> json) -> string -> ('a option -> 'b) -> unit
exception
Jsonrpc2_error of int * string
type message
= Jsonrpc2__Jsonrpc2_core.Make(IO_sync).message
val request : t -> meth:string -> params:json option -> message * (json, int * string) Pervasives.result IO.Future.t
val notify : t -> meth:string -> params:json option -> message
val send : t -> message -> (unit, exn) Pervasives.result IO.t
val send_batch : t -> message list -> (unit, exn) Pervasives.result IO.t
val send_request : t -> meth:string -> params:json option -> (json, exn) Pervasives.result IO.t
val send_notify : t -> meth:string -> params:json option -> (unit, exn) Pervasives.result IO.t
val send_request_with : encode_params:('a -> json) -> decode_res:(json -> ('b, string) Pervasives.result) -> t -> meth:string -> params:'a option -> ('b, exn) Pervasives.result IO.t
val send_notify_with : encode_params:('a -> json) -> t -> meth:string -> params:'a option -> (unit, exn) Pervasives.result IO.t
val run : t -> (unit, exn) Pervasives.result IO.t