package async_rpc_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val dispatch_iter : ('query, 'response, 'error) t -> Connection.t -> 'query -> f:(Core.Bigstring.t -> pos:int -> len:int -> Pipe_response.t) -> closed:([ `By_remote_side | `Error of Core.Error.t ] -> unit) -> (Id.t, 'error) Core.Result.t Core.Or_error.t Async_kernel.Deferred.t

Expert.dispatch_iter is like dispatch_iter except it provides the buffer that the update is in directly. In some RPC transports, the buffer provided is the buffer that is being used to read from the connection, so it will eventually be re-used and the contents will be overwritten. It's guaranteed not to be re-used before either:

  • f completes, returning Continue
  • f completes, returning Wait d, and d becomes determined

closed will be called once, after which f will not be called.

Like the non-expert dispatch_iter, nothing will be read from the Connection.t between f returning wait d and d becoming determined.

Note that unlike the non-expert dispatch_iter, exceptions from f are caught, resulting in closed being invoked, instead of terminating the connection.

OCaml

Innovation. Community. Security.