package grpc-lwt

  1. Overview
  2. Docs

Module Server.RpcSource

Sourcetype unary = string -> (Grpc.Status.t * string option) Lwt.t

unary is the type for a unary grpc rpc, one request, one response.

Sourcetype client_streaming = string Lwt_stream.t -> (Grpc.Status.t * string option) Lwt.t

client_streaming is the type for an rpc where the client streams the requests and the server responds once.

Sourcetype server_streaming = string -> (string -> unit) -> Grpc.Status.t Lwt.t

server_streaming is the type for an rpc where the client sends one request and the server sends multiple responses.

Sourcetype bidirectional_streaming = string Lwt_stream.t -> (string -> unit) -> Grpc.Status.t Lwt.t

bidirectional_streaming is the type for an rpc where both the client and server can send multiple messages.

Sourcetype t =
  1. | Unary of unary
  2. | Client_streaming of client_streaming
  3. | Server_streaming of server_streaming
  4. | Bidirectional_streaming of bidirectional_streaming

t represents the types of rpcs available in gRPC.

Sourceval unary : f:unary -> H2.Reqd.t -> unit Lwt.t

unary ~f reqd calls f with the request obtained from reqd and handles sending the response.

Sourceval client_streaming : f:client_streaming -> H2.Reqd.t -> unit Lwt.t

client_streaming ~f reqd calls f with a stream to pull requests from and handles sending the response.

Sourceval server_streaming : f:server_streaming -> H2.Reqd.t -> unit Lwt.t

server_streaming ~f reqd calls f with the request optained from reqd and handles sending the responses pushed out.

Sourceval bidirectional_streaming : f:bidirectional_streaming -> H2.Reqd.t -> unit Lwt.t

bidirectional_streaming ~f reqd calls f with a stream to pull requests from and andles sending the responses pushed out.

OCaml

Innovation. Community. Security.