package shuttle

  1. Overview
  2. Docs

Module Shuttle.Output_channelSource

Alternative to Async_unix.Writer, based on the low latency transport in async_rpc.

Sourcetype t
Sourceval sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
Sourceval create : ?initial_buffer_size:int -> ?write_timeout:Core.Time_ns.Span.t -> Async_unix.Fd.t -> t

create ?initial_buffer_size ?max_buffer_size ?write_timeout fd creates a new writer.

The writer doesn't flush automatically and the user is responsible for calling flush, which triggers a write system call if needed.

Sourceval is_closed : t -> bool
Sourceval is_open : t -> bool
Sourceval close_started : t -> unit Async_kernel.Deferred.t
Sourceval close_finished : t -> unit Async_kernel.Deferred.t
Sourceval write_bigstring : t -> ?pos:int -> ?len:int -> Core.Bigstring.t -> unit

write_bigstring copies the bigstring into the channel's internal buffer. It is safe to modify the bigstring once write_bigstring returns.

Sourceval schedule_bigstring : t -> ?pos:int -> ?len:int -> Core.Bigstring.t -> unit
  • alert info schedule_bigstring will be removed in a future release. Use [write_bigstring] instead.
Sourceval write_string : t -> ?pos:int -> ?len:int -> string -> unit

write_string copies the string into the channel's internal buffer. The string will surface the next time the writer schedules a write.

Sourceval write_char : t -> char -> unit
Sourceval writef : t -> ('a, unit, string, unit) Core.format4 -> 'a
Sourceval close : t -> unit Async_kernel.Deferred.t

close will close the underlying file descriptor after waiting for the writer to be flushed.

Sourceval flush : t -> unit

flush will schedule a write system call if one is needed.

Sourceval flushed : t -> unit Async_kernel.Deferred.t

flushed t f deferred that will get resolved when all prior writes have finished.

Sourceval pipe : t -> string Async_kernel.Pipe.Writer.t
Sourceval of_pipe : Core.Info.t -> string Async_kernel.Pipe.Writer.t -> (t * unit Async_kernel.Deferred.t) Async_kernel.Deferred.t
OCaml

Innovation. Community. Security.