Up

Module Client

Signature

type t
module Error : sig .. end
module Message : sig .. end
module Response : sig .. end
val connect : host:string -> port:int -> (t, Core.Std.Exn.t) Core.Std.Result.t Async_extra.Import.Deferred.t

connect ~host ~port connect to the server at (host,port)

val disconnect : t -> unit Async_extra.Import.Deferred.t

disconnect t disconnect from t. Pipes delivered by read/tail will be closed.

val read : ?client_pushes_back:unit -> t -> string -> Response.t Async_extra.Import.Pipe.Reader.t Async_extra.Import.Deferred.t

read ?client_pushes_back t filename provides a pipe that will be filled with messages from filename starting from the beginning, and continuing until the server calls unlink or close. The client can indicate that it is no longer interested by calling Pipe.close_reader. See Rpc.Pipe_rpc.create for the definition on ?client_pushes_back and its implications. Passing the client_pushes_back argument will have no detrimental effect on a server that is delivering from a file. If the client caught up, effectively tailing the file, then the server will enqueue the data in memory until the client catches up, or gets disconnected.

val tail : ?client_pushes_back:unit -> t -> string -> Response.t Async_extra.Import.Pipe.Reader.t Async_extra.Import.Deferred.t

tail ?client_pushes_back t filename same as read, but delivers messages starting at some unspecified point near the current end of the file and continuing until the server calls unlink or close. The client can indicate that it is no longer interested by calling Pipe.close_reader.