Up

Module Rpc = Async_extra.Import.Rpc_kernel.Rpc

Signature

type ('query, 'response) t
val create : name:string -> version:int -> bin_query:'query Core_kernel.Std.Bin_prot.Type_class.t -> bin_response:'response Core_kernel.Std.Bin_prot.Type_class.t -> ('query, 'response) t
val name : (_, _) t -> string

the same values as were passed to create.

val version : (_, _) t -> int
val description : (_, _) t -> Rpc_kernel.Description.t
val bin_query : ('query, _) t -> 'query Core_kernel.Std.Bin_prot.Type_class.t
val bin_response : (_, 'response) t -> 'response Core_kernel.Std.Bin_prot.Type_class.t
val implement : ('query, 'response) t -> ('connection_state -> 'query -> 'response Async_kernel.Std.Deferred.t) -> 'connection_state Rpc_kernel.Implementation.t
val implement' : ('query, 'response) t -> ('connection_state -> 'query -> 'response) -> 'connection_state Rpc_kernel.Implementation.t

implement' is different from implement in that:

1. 'response is immediately serialized and scheduled for delivery to the RPC dispatcher.

2. Less allocation happens, as none of the Async-related machinery is necessary.

implement also tries to do 1 when possible, but it is guaranteed to happen with implement'.

val dispatch : ('query, 'response) t -> Rpc_kernel.Connection.t -> 'query -> 'response Core_kernel.Std.Or_error.t Async_kernel.Std.Deferred.t
val dispatch_exn : ('query, 'response) t -> Rpc_kernel.Connection.t -> 'query -> 'response Async_kernel.Std.Deferred.t
module Expert : sig .. end