package grpc-async

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val bidirectional_streaming : handler: (string Async.Pipe.Writer.t -> string Async.Pipe.Reader.t -> 'a Async.Deferred.t) -> 'a handler

bidirectional_streaming ~handler write read sets up the sending and receiving logic using write and read, then calls handler with a writer pipe and a reader pipe, for sending and receiving payloads to and from the server.

The stream is closed when the deferred returned by the handler becomes determined.

val client_streaming : handler: (string Async.Pipe.Writer.t -> string option Async.Deferred.t -> 'a Async.Deferred.t) -> 'a handler

client_streaming ~handler write read sets up the sending and receiving logic using write and read, then calls handler with a writer pipe to send payloads to the server.

The stream is closed when the deferred returned by the handler becomes determined.

val server_streaming : handler:(string Async.Pipe.Reader.t -> 'a Async.Deferred.t) -> encoded_request:string -> 'a handler

server_streaming ~handler encoded_request write read sets up the sending and receiving logic using write and read, then sends encoded_request and calls handler with a pipe of responses.

The stream is closed when the deferred returned by the handler becomes determined.

val unary : handler:(string option -> 'a Async.Deferred.t) -> encoded_request:string -> 'a handler

unary ~handler ~encoded_request sends the encoded request to the server . When the response is received, the handler is called with an option response. The response is is None if the server sent an empty response.

OCaml

Innovation. Community. Security.