package resp-client

  1. Overview
  2. Docs

Source file resp_client_intf.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
module type S = sig
  include Resp.S

  type t

  type params

  val connect : params -> t Lwt.t

  val read : t -> Resp.t Lwt.t

  val write : t -> Resp.t -> unit Lwt.t

  val run : t -> Resp.t list -> Resp.t Lwt.t

  val run_s : t -> string list -> Resp.t Lwt.t

  val decode : t -> Resp.lexeme -> Resp.t Lwt.t

  val read_lexeme : t -> Resp.lexeme Lwt.t
end

module type CLIENT = sig
  type ic

  type oc

  type params

  val connect : params -> (ic * oc) Lwt.t
end

module type Client = sig
  module type S = S

  module type CLIENT = CLIENT

  module Make
      (Client : CLIENT)
      (S : Resp.S with type Reader.ic = Client.ic and type Writer.oc = Client.oc) :
    S
      with module Reader = S.Reader
       and module Writer = S.Writer
       and type t = Client.ic * Client.oc
       and type params = Client.params
end