package async_unix

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Core_unix = Core.Unix
module Unix = Unix_syscalls
module IOVec = Core.Unix.IOVec
module Id : sig ... end
val io_stats : Io_stats.t
val debug : bool
module Line_ending : sig ... end
module Check_buffer_age' : sig ... end
module Open_flags = Unix.Open_flags
type open_flags = (Open_flags.t, exn) Core.Result.t
val sexp_of_open_flags : open_flags -> Sexplib.Sexp.t
module Scheduled : sig ... end
type t = {
  1. id : Id.t;
  2. mutable fd : Fd.t;
  3. monitor : Async_unix.Import.Monitor.t;
  4. inner_monitor : Async_unix.Import.Monitor.t;
  5. mutable background_writer_state : [ `Running | `Not_running | `Stopped_permanently ];
  6. background_writer_stopped : unit Async_unix.Import.Ivar.t;
  7. syscall : [ `Per_cycle | `Periodic of Core.Time.Span.t ];
  8. mutable bytes_received : Core.Int63.t;
  9. mutable bytes_written : Core.Int63.t;
  10. scheduled : Scheduled.t Core.sexp_opaque;
  11. mutable scheduled_bytes : int;
  12. mutable buf : Core.Bigstring.t Core.sexp_opaque;
  13. mutable scheduled_back : int;
  14. mutable back : int;
  15. flushes : (Core.Time_ns.t Async_unix.Import.Ivar.t * Core.Int63.t) Core.Queue.t Core.sexp_opaque;
  16. mutable close_state : [ `Open | `Closed_and_flushing | `Closed ];
  17. close_finished : unit Async_unix.Import.Ivar.t;
  18. close_started : unit Async_unix.Import.Ivar.t;
  19. producers_to_flush_at_close : (unit -> unit Async_unix.Import.Deferred.t) Core.Bag.t;
  20. mutable flush_at_shutdown_elt : t Core.sexp_opaque Core.Bag.Elt.t option;
  21. mutable check_buffer_age : t Core.sexp_opaque Check_buffer_age'.t Core.Bag.Elt.t option;
  22. consumer_left : unit Async_unix.Import.Ivar.t;
  23. mutable raise_when_consumer_leaves : bool;
    (*

    default is true

    *)
  24. open_flags : open_flags Async_unix.Import.Deferred.t;
  25. line_ending : Line_ending.t;
}
val line_ending : t -> Line_ending.t
val raise_when_consumer_leaves : t -> bool
val check_buffer_age : t -> t Core.sexp_opaque Check_buffer_age'.t Core.Bag.Elt.t option
val set_check_buffer_age : t -> t Core.sexp_opaque Check_buffer_age'.t Core.Bag.Elt.t option -> unit
val flush_at_shutdown_elt : t -> t Core.sexp_opaque Core.Bag.Elt.t option
val set_flush_at_shutdown_elt : t -> t Core.sexp_opaque Core.Bag.Elt.t option -> unit
val producers_to_flush_at_close : t -> (unit -> unit Async_unix.Import.Deferred.t) Core.Bag.t
val close_state : t -> [ `Closed | `Closed_and_flushing | `Open ]
val set_close_state : t -> [ `Closed | `Closed_and_flushing | `Open ] -> unit
val back : t -> int
val set_back : t -> int -> unit
val scheduled_back : t -> int
val set_scheduled_back : t -> int -> unit
val set_buf : t -> Core.Bigstring.t Core.sexp_opaque -> unit
val scheduled_bytes : t -> int
val set_scheduled_bytes : t -> int -> unit
val scheduled : t -> Scheduled.t Core.sexp_opaque
val bytes_written : t -> Core.Int63.t
val set_bytes_written : t -> Core.Int63.t -> unit
val bytes_received : t -> Core.Int63.t
val set_bytes_received : t -> Core.Int63.t -> unit
val syscall : t -> [ `Per_cycle | `Periodic of Core.Time.Span.t ]
val background_writer_stopped : t -> unit Async_unix.Import.Ivar.t
val background_writer_state : t -> [ `Not_running | `Running | `Stopped_permanently ]
val set_background_writer_state : t -> [ `Not_running | `Running | `Stopped_permanently ] -> unit
val inner_monitor : t -> Async_unix.Import.Monitor.t
val fd : t -> Fd.t
val id : t -> Id.t
module Fields : sig ... end
exception Inner_exn of t * Core.Sexp.t
val inner_raise_s : t -> Core.Sexp.t -> 'a
val sexp_of_t : t -> Sexplib.Sexp.t
type writer = t
val sexp_of_writer : writer -> Sexplib.Sexp.t
val set_raise_when_consumer_leaves : t -> bool -> unit
val bytes_to_write : t -> int
val is_stopped_permanently : t -> bool
val invariant : t Core.sexp_opaque -> unit
module Check_buffer_age : sig ... end
val flushed_time_ns : t -> Core.Time_ns.t Async_kernel__.Types.Deferred.t
val flushed : t -> unit Async_kernel__.Types.Deferred.t
val set_fd : t -> Fd.t -> unit Async_kernel__.Types.Deferred.t
val consumer_left : t -> unit Async_kernel__.Types.Deferred.t
val close_finished : t -> unit Async_kernel__.Types.Deferred.t
val close_started : t -> unit Async_kernel__.Types.Deferred.t
val is_closed : t -> bool
val is_open : t -> bool
val writers_to_flush_at_shutdown : t Core.Bag.t
val final_flush : ?force:unit Async_unix.Import.Deferred.t -> t -> unit Async_unix.Import.Deferred.t
val close : ?force_close:unit Async_unix.Import.Deferred.t -> t -> unit Async_kernel__.Types.Deferred.t
val fill_flushes : t -> unit
val stop_permanently : t -> unit
val stopped_permanently : t -> unit Async_kernel__.Types.Deferred.t
val die : t -> Core.Sexp.t -> 'a
type buffer_age_limit = [
  1. | `At_most of Core.Time.Span.t
  2. | `Unlimited
]
val bin_shape_buffer_age_limit : Core.Bin_prot.Shape.t
val bin_size_buffer_age_limit : [> `At_most of Core.Time.Span.t ] -> int
val bin_write_buffer_age_limit : Bin_prot.Common.buf -> pos:Bin_prot.Common.pos -> [< `At_most of Core.Time.Span.t | `Unlimited ] -> Bin_prot.Common.pos
val bin_writer_buffer_age_limit : [< `At_most of Core.Time.Span.t | `Unlimited At_most ] Core.Bin_prot.Type_class.writer
val __bin_read_buffer_age_limit__ : Bin_prot.Common.buf -> pos_ref:Bin_prot.Common.pos_ref -> int -> [> `At_most of Core.Time.Span.t | `Unlimited ]
val bin_read_buffer_age_limit : Bin_prot.Common.buf -> pos_ref:Bin_prot.Common.pos_ref -> [> `At_most of Core.Time.Span.t | `Unlimited ]
val bin_reader_buffer_age_limit : [> `At_most of Core.Time.Span.t | `Unlimited ] Core.Bin_prot.Type_class.reader
val bin_buffer_age_limit : [ `At_most of Core.Time.Span.t | `Unlimited ] Core.Bin_prot.Type_class.t
val __buffer_age_limit_of_sexp__ : Sexplib.Sexp.t -> buffer_age_limit
val buffer_age_limit_of_sexp : Sexplib.Sexp.t -> buffer_age_limit
val sexp_of_buffer_age_limit : buffer_age_limit -> Sexplib.Sexp.t
val create : ?buf_len:Base.Int.t -> ?syscall:[ `Per_cycle | `Periodic of Core.Time.Span.t ] -> ?buffer_age_limit:[ `At_most of Core.Time.Span.t | `Unlimited ] -> ?raise_when_consumer_leaves:bool -> ?line_ending:Line_ending.t -> Fd.t -> t
val set_buffer_age_limit : writer -> [ `At_most of Core.Time.Span.t | `Unlimited ] -> unit
val of_out_channel : Core.Out_channel.t -> Fd.Kind.t -> t
val can_write : t -> bool
val ensure_can_write : t -> unit
val open_file : ?append:bool -> ?buf_len:Base.Int.t -> ?perm:Unix.file_perm -> ?line_ending:Line_ending.t -> string -> t Async_kernel__.Types.Deferred.t
val with_writer_exclusive : t -> (unit -> 'a Async_unix.Import.Monitor.Deferred.t) -> 'a Async_kernel__.Types.Deferred.t
val with_file : ?perm:Unix.file_perm -> ?append:bool -> ?exclusive:bool -> ?line_ending:Line_ending.t -> string -> f:(t -> 'a Async_unix.Import.Monitor.Deferred.t) -> 'a Async_kernel__.Types.Deferred.t
val got_bytes : t -> int -> unit
val add_iovec : t -> [ `Destroy | `Keep ] -> Core.Bigstring.t IOVec.t -> count_bytes_as_received:bool -> unit
val schedule_unscheduled : t -> [ `Destroy | `Keep ] -> unit
val dummy_iovec : IOVec.bigstring IOVec.t
val mk_iovecs : t -> IOVec.bigstring IOVec.t Core.Array.t * bool * int
val thread_io_cutoff : int
val fd_closed : t -> unit
val start_write : t -> unit
val write_when_ready : t -> unit
val write_finished : t -> Base.Int.t -> unit
val maybe_start_writer : t -> unit
val give_buf : t -> Base.Int.t -> Core.Bigstring.t Core.sexp_opaque * int
val write_gen_internal : t -> 'a -> src_pos:int -> src_len:Base.Int.t -> allow_partial_write:bool -> blit_to_bigstring:('a, Core.Bigstring.t) Core.Blit.blit -> unit
val write_direct : t -> f: (Core.Bigstring.t Core.sexp_opaque -> pos:int -> len:int -> 'a * Base.Int.t) -> 'a option
val write_gen_unchecked : ?pos:int -> ?len:int -> t -> 'a -> blit_to_bigstring:('a, Core.Bigstring.t) Core.Blit.blit -> length:('a -> int) -> unit
val write_gen_whole_unchecked : t -> 'a -> blit_to_bigstring:('a -> Core.Bigstring.t -> pos:int -> unit) -> length:('a -> Base.Int.t) -> unit
val write_gen_whole : t -> 'a -> blit_to_bigstring:('a -> Core.Bigstring.t -> pos:int -> unit) -> length:('a -> Base.Int.t) -> unit
val to_formatter : t -> Format.formatter
module Terminate_with : sig ... end
val write_sexp_internal : terminate_with:Terminate_with.t -> ?hum:bool -> t -> Core.Sexp.t -> unit
val write_bin_prot_no_size_header : t -> size:Base.Int.t -> (Core.Bigstring.t Core.sexp_opaque -> pos:int -> 'a -> int) -> 'a -> unit
val fsync : t -> unit Async_kernel__.Types.Deferred.t
val fdatasync : t -> unit Async_kernel__.Types.Deferred.t
val write_bin_prot : t -> 'a Core.Bin_prot.Type_class.writer -> 'a -> unit
val send : t -> Core.String.t -> unit
val schedule_iovec : t -> Core.Bigstring.t IOVec.t -> unit
val schedule_iovecs : t -> Core.Bigstring.t IOVec.t Core.Queue.t -> unit
val schedule_bigstring : t -> ?pos:int -> ?len:int -> IOVec.bigstring -> unit
val schedule_bigsubstring : t -> Core.Bigsubstring.t -> unit
val schedule_iobuf_peek : t -> ?pos:int -> ?len:int -> ('a, 'b) Core__Iobuf.t -> unit
val schedule_iobuf_consume : t -> ?len:int -> ('a, Core.Iobuf.seek) Core.Iobuf.t -> unit Async_kernel__.Types.Deferred.t
val write_gen : ?pos:int -> ?len:int -> t -> 'a -> blit_to_bigstring:('a, Core.Bigstring.t) Core.Blit.blit -> length:('a -> int) -> unit
val write : ?pos:int -> ?len:int -> t -> Base.String.t -> unit
val write_line : ?line_ending:Line_ending.t -> t -> Base.String.t -> unit
val writef : t -> ('a, unit, string, unit) Pervasives.format4 -> 'a
val write_marshal : t -> flags:Marshal.extern_flags Base.List.t -> 'a -> unit
val write_sexp : ?hum:bool -> ?terminate_with:Terminate_with.t -> t -> Core.Sexp.t -> unit
val write_iobuf : ?pos:int -> ?len:int -> t -> ([> Core_kernel.Perms.Read.t ], 'a) Core.Iobuf.t -> unit
val write_bigstring : ?pos:int -> ?len:int -> t -> Core.Bigstring.t -> unit
val write_bigsubstring : t -> Core.Bigsubstring.t -> unit
val write_substring : t -> Core.Substring.t -> unit
val write_byte : t -> Core.Int.t -> unit
val write_char : t -> Base.Char.t -> unit
val newline : ?line_ending:Line_ending.t -> t -> unit
val stdout_and_stderr : (t * t) lazy_t
val stdout : t lazy_t
val stderr : t lazy_t
val behave_nicely_in_pipeline : ?writers:writer Core.List.t -> unit -> unit
val apply_umask : int -> int
val with_file_atomic : ?temp_file:Base.String.t -> ?perm:int -> ?fsync:bool -> Base.String.t -> f:(t -> 'a Async_kernel__.Types.Deferred.t) -> 'a Async_kernel__.Types.Deferred.t
val save : ?temp_file:Base.String.t -> ?perm:int -> ?fsync:bool -> Base.String.t -> contents:Base.String.t -> unit Async_kernel__.Types.Deferred.t
val save_lines : ?temp_file:Base.String.t -> ?perm:int -> ?fsync:bool -> Base.String.t -> Base.String.t Core.List.t -> unit Async_kernel__.Types.Deferred.t
val save_sexp : ?temp_file:Base.String.t -> ?perm:int -> ?fsync:bool -> ?hum:bool -> Base.String.t -> Core.Sexp.t -> unit Async_kernel__.Types.Deferred.t
val save_sexps : ?temp_file:Base.String.t -> ?perm:int -> ?fsync:bool -> ?hum:bool -> Base.String.t -> Core.Sexp.t Core.List.t -> unit Async_kernel__.Types.Deferred.t
val save_bin_prot : ?temp_file:Base.String.t -> ?perm:int -> ?fsync:bool -> Base.String.t -> 'a Core.Bin_prot.Type_class.writer -> 'a -> unit Async_kernel__.Types.Deferred.t
val with_flushed_at_close : t -> flushed:(unit -> unit Async_unix.Import.Deferred.t) -> f:(unit -> 'a Async_unix.Import.Monitor.Deferred.t) -> 'a Async_unix.Import.Monitor.Deferred.t
val make_transfer : ?stop:unit Async_unix.Import.Deferred.t -> ?max_num_values_per_read:int -> t -> 'a Async_unix.Import.Pipe.Reader.t -> ('a Core_kernel.Queue.t -> cont:(unit -> unit) -> unit) -> unit Async_unix.Import.Monitor.Deferred.t
val transfer : ?stop:unit Async_unix.Import.Deferred.t -> ?max_num_values_per_read:int -> t -> 'a Async_unix.Import.Pipe.Reader.t -> ('a -> unit) -> unit Async_unix.Import.Monitor.Deferred.t
val transfer' : ?stop:unit Async_unix.Import.Deferred.t -> ?max_num_values_per_read:int -> t -> 'a Async_unix.Import.Pipe.Reader.t -> ('a Core_kernel.Queue.t -> unit Async_kernel__.Types.Deferred.t) -> unit Async_unix.Import.Monitor.Deferred.t
OCaml

Innovation. Community. Security.