Module Debug_rpc
type progress= < start : unit -> unit Lwt.t; update : int -> int -> unit Lwt.t; finish : unit -> unit Lwt.t; >
val create : in_:Lwt_io.input_channel -> out:Lwt_io.output_channel -> ?next_seq:int -> unit -> tcreate ~in_ ~out ?next_seq ()Create a rpc connection
val event : t -> (module Debug_protocol.EVENT with type Payload.t = 'a) -> 'a React.E.tevent rpc (module The_event)Get aThe_event.Payload.t React.E.tfor opposite end sent events
val send_event : t -> (module Debug_protocol.EVENT with type Payload.t = 'a) -> 'a -> unit Lwt.tsend_event rpc (module The_event) payloadSend event withpayloadto the opposite end
val set_progressive_command_handler : t -> (module Debug_protocol.COMMAND with type Arguments.t = 'a and type Result.t = 'b) -> ('a -> progress -> 'b Lwt.t) -> unitset_command_handler rpc (module The_command) fSet handlerfforThe_command
val set_command_handler : t -> (module Debug_protocol.COMMAND with type Arguments.t = 'a and type Result.t = 'b) -> ('a -> 'b Lwt.t) -> unitset_command_handler rpc (module The_command) fSet handlerfforThe_command
val remove_command_handler : t -> (module Debug_protocol.COMMAND) -> unitremove_command_handler rpc (module The_command)Remove handler forThe_command
val exec_command : t -> (module Debug_protocol.COMMAND with type Arguments.t = 'a and type Result.t = 'b) -> 'a -> 'b Lwt.texec_command rpc (module The_command) argExecuteThe_commandwithargon the opposite end.- returns
resReturns promise ofThe_command.Result.t. You can useLwt.cancelon it to cancel the request.
val start : t -> unit Lwt.tstart rpcStart rpc dispatch loop. You must call it before interact with rpc. This method will block until input_channel closed. You may call it in aLwt.asyncblock