Server.Rpc
type unary = string -> Grpc.Status.t * string option
unary
is the type for a unary grpc rpc, one request, one response.
type client_streaming = string Seq.t -> Grpc.Status.t * string option
client_streaming
is the type for an rpc where the client streams the requests and the server responds once.
type server_streaming = string -> (string -> unit) -> Grpc.Status.t
server_streaming
is the type for an rpc where the client sends one request and the server sends multiple responses.
type bidirectional_streaming =
string Seq.t ->
(string -> unit) ->
Grpc.Status.t
bidirectional_streaming
is the type for an rpc where both the client and server can send multiple messages.
type t =
| Unary of unary
| Client_streaming of client_streaming
| Server_streaming of server_streaming
| Bidirectional_streaming of bidirectional_streaming
t
represents the types of rpcs available in gRPC.
unary ~f reqd
calls f
with the request obtained from reqd
and handles sending the response.
val client_streaming : f:client_streaming -> H2.Reqd.t -> unit
client_streaming ~f reqd
calls f
with a stream to pull requests from and handles sending the response.
val server_streaming : f:server_streaming -> H2.Reqd.t -> unit
server_streaming ~f reqd
calls f
with the request optained from reqd
and handles sending the responses pushed out.
val bidirectional_streaming : f:bidirectional_streaming -> H2.Reqd.t -> unit
bidirectional_streaming ~f reqd
calls f
with a stream to pull requests from and andles sending the responses pushed out.