package async_rpc_kernel

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Rpc.RpcSource

Sourcetype ('query, 'response) t
Sourceval create : name:string -> version:int -> bin_query:'query Core.Bin_prot.Type_class.t -> bin_response:'response Core.Bin_prot.Type_class.t -> ('query, 'response) t
Sourceval name : (_, _) t -> string

the same values as were passed to create.

Sourceval version : (_, _) t -> int
Sourceval description : (_, _) t -> Description.t
Sourceval query_type_id : ('query, _) t -> 'query Core.Type_equal.Id.t
Sourceval response_type_id : (_, 'response) t -> 'response Core.Type_equal.Id.t
Sourceval bin_query : ('query, _) t -> 'query Core.Bin_prot.Type_class.t
Sourceval bin_response : (_, 'response) t -> 'response Core.Bin_prot.Type_class.t
Sourceval implement : ?on_exception:On_exception.t -> ('query, 'response) t -> ('connection_state -> 'query -> 'response Async_kernel.Deferred.t) -> 'connection_state Implementation.t

If the function that implements the RPC raises, the implementer does not see the exception. Instead, it is sent as an error to the caller of the RPC, i.e. the process that called dispatch or one of its alternatives.

Sourceval implement' : ?on_exception:On_exception.t -> ('query, 'response) t -> ('connection_state -> 'query -> 'response) -> 'connection_state 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'.

Sourceval dispatch' : ('query, 'response) t -> Connection.t -> 'query -> 'response Rpc_result.t Async_kernel.Deferred.t

dispatch' exposes Rpc_result.t as output. Passing it through rpc_result_to_or_error gives you the same result as dispatch

Sourceval rpc_result_to_or_error : ('query, 'response) t -> Connection.t -> 'response Rpc_result.t -> 'response Core.Or_error.t
Sourceval dispatch : ('query, 'response) t -> Connection.t -> 'query -> 'response Core.Or_error.t Async_kernel.Deferred.t
Sourceval dispatch_exn : ('query, 'response) t -> Connection.t -> 'query -> 'response Async_kernel.Deferred.t
Sourcemodule Expert : sig ... end
OCaml

Innovation. Community. Security.