module State_rpc: sig
.. end
A state rpc is an easy way for two processes to synchronize a data structure by
sending updates over the wire. It's basically a pipe rpc that sends/receives an
initial state of the data structure, and then updates, and applies the updates under
the covers.
type ('query, 'state, 'update, 'error)
t
module Id: sig
.. end
val create : name:string ->
version:int ->
bin_query:'query Bin_prot.Type_class.t ->
bin_state:'state Bin_prot.Type_class.t ->
bin_update:'update Bin_prot.Type_class.t ->
bin_error:'error Bin_prot.Type_class.t ->
('query, 'state, 'update, 'error) t
val bin_query : ('query, 'a, 'b, 'c) t -> 'query Bin_prot.Type_class.t
val bin_state : ('a, 'state, 'b, 'c) t -> 'state Bin_prot.Type_class.t
val bin_update : ('a, 'b, 'update, 'c) t ->
'update Bin_prot.Type_class.t
val bin_error : ('a, 'b, 'c, 'error) t -> 'error Bin_prot.Type_class.t
val implement : ('query, 'state, 'update, 'error) t ->
('connection_state ->
'query ->
aborted:unit Import.Deferred.t ->
('state * 'update Import.Pipe.Reader.t, 'error) Core.Std.Result.t
Import.Deferred.t) ->
'connection_state Rpc.Implementation.t
val dispatch : ('query, 'state, 'update, 'error) t ->
Rpc.Connection.t ->
'query ->
update:('state -> 'update -> 'state) ->
('state * ('state * 'update) Import.Pipe.Reader.t * Id.t,
'error)
Core.Std.Result.t Core.Std.Or_error.t Import.Deferred.t
val abort : ('a, 'b, 'c, 'd) t ->
Rpc.Connection.t -> Id.t -> unit
val name : ('a, 'b, 'c, 'd) t -> string
val version : ('a, 'b, 'c, 'd) t -> int