Module Rpc.State_rpc

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 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