Up

Module Writer0

Signature

module Id : sig .. end
val io_stats : Io_stats.t
val debug : bool
module Check_buffer_age' : sig .. end
type open_flags = (Open_flags.t, exn) Core.Std.Result.t
val sexp_of_open_flags : open_flags -> Sexplib.Sexp.t
module Scheduled : sig .. end
type t = {
id
: Id.t ;
mutable fd
: Fd.t ;
monitor
: Import.Monitor.t ;
inner_monitor
: Import.Monitor.t ;
mutable background_writer_state
: [
| `Running
| `Not_running
| `Stopped_permanently
]
;
syscall
: [
| `Per_cycle
| `Periodic of Core.Std.Time.Span.t
]
;
mutable bytes_received
: Core.Std.Int63.t ;
mutable bytes_written
: Core.Std.Int63.t ;
scheduled
: Scheduled.t Core.Std.sexp_opaque ;
mutable scheduled_bytes
: int ;
mutable buf
: Core.Std.Bigstring.t Core.Std.sexp_opaque ;
mutable scheduled_back
: int ;
mutable back
: int ;
flushes
: (Core.Std.Time.t Import.Ivar.t * Core.Std.Int63.t) Core.Std.Queue.t Core.Std.sexp_opaque ;
mutable close_state
: [
| `Open
| `Closed_and_flushing
| `Closed
]
;
close_finished
: unit Import.Ivar.t ;
close_started
: unit Import.Ivar.t ;
producers_to_flush_at_close
: (unit -> unit Import.Deferred.t) Core.Std.Bag.t ;
mutable flush_at_shutdown_elt
: t Core.Std.sexp_opaque Core.Std.Bag.Elt.t option ;
mutable check_buffer_age
: t Core.Std.sexp_opaque Check_buffer_age'.t Core.Std.Bag.Elt.t option ;
consumer_left
: unit Import.Ivar.t ;
mutable raise_when_consumer_leaves
: bool ; (* default is true *)
open_flags
: open_flags Import.Deferred.t ;
}
val sexp_of_t : t -> Sexplib.Sexp.t
val open_flags : t -> open_flags Import.Deferred.t
val raise_when_consumer_leaves : t -> bool
val set_raise_when_consumer_leaves : t -> bool -> unit
val consumer_left : t -> unit Import.Ivar.t
val set_check_buffer_age : t -> t Core.Std.sexp_opaque Check_buffer_age'.t Core.Std.Bag.Elt.t option -> unit
val flush_at_shutdown_elt : t -> t Core.Std.sexp_opaque Core.Std.Bag.Elt.t option
val set_flush_at_shutdown_elt : t -> t Core.Std.sexp_opaque Core.Std.Bag.Elt.t option -> unit
val producers_to_flush_at_close : t -> (unit -> unit Import.Deferred.t) Core.Std.Bag.t
val close_started : t -> unit Import.Ivar.t
val close_finished : t -> unit Import.Ivar.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.Std.Bigstring.t Core.Std.sexp_opaque -> unit
val scheduled_bytes : t -> int
val set_scheduled_bytes : t -> int -> unit
val scheduled : t -> Scheduled.t Core.Std.sexp_opaque
val bytes_written : t -> Core.Std.Int63.t
val set_bytes_written : t -> Core.Std.Int63.t -> unit
val bytes_received : t -> Core.Std.Int63.t
val set_bytes_received : t -> Core.Std.Int63.t -> unit
val syscall : t -> [
| `Per_cycle
| `Periodic of Core.Std.Time.Span.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 -> Import.Monitor.t
val monitor : t -> Import.Monitor.t
val fd : t -> Fd.t
val set_fd : t -> Fd.t -> unit
val id : t -> Id.t
module Fields : sig .. end
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.Std.sexp_opaque -> unit
module Check_buffer_age : sig .. end
val flushed_time : t -> Core.Std.Time.t Import.Deferred.t
val flushed : t -> unit Import.Deferred.t
val set_fd : t -> Fd.t -> unit Import.Deferred.t
val consumer_left : t -> unit Async_kernel.Deferred0.t
val close_finished : t -> unit Async_kernel.Deferred0.t
val close_started : t -> unit Async_kernel.Deferred0.t
val is_closed : t -> bool
val is_open : t -> bool
val final_flush : ?force:unit Import.Deferred.t -> t -> unit Import.Deferred.t
val close : ?force_close:unit Import.Deferred.t -> t -> unit Async_kernel.Deferred0.t
val fill_flushes : t -> unit
val stop_permanently : t -> unit
val die : t -> Core.Std.Error.t -> 'a
type buffer_age_limit = [
| `At_most of Core.Std.Time.Span.t
| `Unlimited
]
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 bin_size_buffer_age_limit : [>
| `At_most of Core.Std.Time.Span.t
] -> int
val bin_write_buffer_age_limit : Bin_prot.Common.buf -> pos:Bin_prot.Common.pos -> [<
| `At_most of Core.Std.Time.Span.t
| `Unlimited
] -> Bin_prot.Common.pos
val bin_writer_buffer_age_limit : [<
| `At_most of Core.Std.Time.Span.t
| `Unlimited
> `At_most] Core.Std.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.Std.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.Std.Time.Span.t
| `Unlimited
]
val bin_reader_buffer_age_limit : [>
| `At_most of Core.Std.Time.Span.t
| `Unlimited
] Core.Std.Bin_prot.Type_class.reader
val bin_buffer_age_limit : [
| `At_most of Core.Std.Time.Span.t
| `Unlimited
] Core.Std.Bin_prot.Type_class.t
val create : ?buf_len:int -> ?syscall:[
| `Per_cycle
| `Periodic of Core.Std.Time.Span.t
] -> ?buffer_age_limit:[
| `At_most of Core.Std.Time.Span.t
| `Unlimited
] -> ?raise_when_consumer_leaves:bool -> Fd.t -> t
val set_buffer_age_limit : writer -> [
| `At_most of Core.Std.Time.Span.t
| `Unlimited
] -> unit
val of_out_channel : Core.Std.Out_channel.t -> Fd.Kind.t -> t
val ensure_can_write : t -> unit
val open_file : ?append:bool -> ?close_on_exec:bool -> ?perm:Unix.file_perm -> string -> t Import.Deferred.t
val with_close : t -> f:(unit -> 'a Import.Monitor.Deferred.t) -> 'a Import.Monitor.Deferred.t
val with_writer_exclusive : t -> (unit -> 'a Import.Monitor.Deferred.t) -> 'a Import.Deferred.t
val with_file : ?perm:Unix.file_perm -> ?append:bool -> ?exclusive:bool -> string -> f:(t -> 'a Import.Monitor.Deferred.t) -> 'a Import.Deferred.t
val got_bytes : t -> int -> unit
val add_iovec : t -> [
| `Destroy
| `Keep
] -> Core.Std.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.Std.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 -> int -> unit
val maybe_start_writer : t -> unit
val give_buf : t -> int -> Core.Std.Bigstring.t Core.Std.sexp_opaque * int
val write_gen : length:('a -> int) -> blit_to_bigstring:('a, Core.Std.Bigstring.t) Core.Std.Blit.blit -> ?pos:int -> ?len:int -> t -> 'a -> unit
val write : ?pos:int -> ?len:int -> t -> Core.Std.String.t -> unit
val write_bigstring : ?pos:int -> ?len:int -> t -> Core.Std.Bigstring.t -> unit
val write_iobuf : ?pos:int -> ?len:int -> t -> ([> ], 'a) Core.Std.Iobuf.t -> unit
val write_substring : t -> Core.Std.Substring.t -> unit
val write_bigsubstring : t -> Core.Std.Bigsubstring.t -> unit
val writef : t -> ('a, unit, string, unit) Pervasives.format4 -> 'a
val to_formatter : t -> Format.formatter
val write_char : t -> char -> unit
val newline : t -> unit
val write_line : t -> Core.Std.String.t -> unit
val write_byte : t -> Core.Std.Int.t -> unit
module Terminate_with : sig .. end
val write_sexp_internal : terminate_with:Terminate_with.t -> ?hum:bool -> t -> Core.Std.Sexp.t -> unit
val write_sexp : ?hum:bool -> ?terminate_with:Terminate_with.t -> t -> Core.Std.Sexp.t -> unit
val write_bin_prot : t -> 'a Core.Std.Bin_prot.Type_class.writer -> 'a -> unit
val write_bin_prot_no_size_header : t -> size:int -> (Core.Std.Bigstring.t Core.Std.sexp_opaque -> pos:int -> 'a -> int) -> 'a -> unit
val write_marshal : t -> flags:Marshal.extern_flags list -> 'a -> unit
val send : t -> Core.Std.String.t -> unit
val schedule_iovec : t -> Core.Std.Bigstring.t IOVec.t -> unit
val schedule_iovecs : t -> Core.Std.Bigstring.t IOVec.t Core.Std.Queue.t -> unit
val schedule_bigstring : t -> ?pos:int -> ?len:int -> IOVec.bigstring -> unit
val schedule_bigsubstring : t -> Core.Std.Bigsubstring.t -> unit
val schedule_iobuf_peek : t -> ?pos:int -> ?len:int -> ('a, 'b) Core.Std.Iobuf.t -> unit
val schedule_iobuf_consume : t -> ?len:int -> ('a, Core.Std.Iobuf.seek) Core.Std.Iobuf.t -> unit Import.Deferred.t
val fsync : t -> unit Import.Deferred.t
val fdatasync : t -> unit Import.Deferred.t
val write_bin_prot : t -> 'a Core.Std.Bin_prot.Type_class.writer -> 'a -> unit
val send : t -> Core.Std.String.t -> unit
val schedule_iovec : t -> Core.Std.Bigstring.t IOVec.t -> unit
val schedule_iovecs : t -> Core.Std.Bigstring.t IOVec.t Core.Std.Queue.t -> unit
val schedule_bigstring : t -> ?pos:int -> ?len:int -> IOVec.bigstring -> unit
val schedule_bigsubstring : t -> Core.Std.Bigsubstring.t -> unit
val schedule_iobuf_peek : t -> ?pos:int -> ?len:int -> ('a, 'b) Core.Std.Iobuf.t -> unit
val schedule_iobuf_consume : t -> ?len:int -> ('a, Core.Std.Iobuf.seek) Core.Std.Iobuf.t -> unit Import.Deferred.t
val write_gen : length:('a -> int) -> blit_to_bigstring:('a, Core.Std.Bigstring.t) Core.Std.Blit.blit -> ?pos:int -> ?len:int -> t -> 'a -> unit
val write : ?pos:int -> ?len:int -> t -> Core.Std.String.t -> unit
val write_line : t -> Core.Std.String.t -> unit
val writef : t -> ('a, unit, string, unit) Pervasives.format4 -> 'a
val write_marshal : t -> flags:Marshal.extern_flags list -> 'a -> unit
val write_sexp : ?hum:bool -> ?terminate_with:Terminate_with.t -> t -> Core.Std.Sexp.t -> unit
val write_iobuf : ?pos:int -> ?len:int -> t -> ([> ], 'a) Core.Std.Iobuf.t -> unit
val write_bigstring : ?pos:int -> ?len:int -> t -> Core.Std.Bigstring.t -> unit
val write_bigsubstring : t -> Core.Std.Bigsubstring.t -> unit
val write_substring : t -> Core.Std.Substring.t -> unit
val write_byte : t -> Core.Std.Int.t -> unit
val write_char : t -> char -> unit
val newline : 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.Std.List.t -> unit -> unit
val apply_umask : int -> int
val with_file_atomic : ?temp_file:string -> ?perm:Unix.file_perm -> ?fsync:bool -> string -> f:(t -> 'a Import.Deferred.t) -> 'a Import.Deferred.t
val save : ?temp_file:string -> ?perm:Unix.file_perm -> ?fsync:bool -> string -> contents:Core.Std.String.t -> unit Import.Deferred.t
val save_lines : ?temp_file:string -> ?perm:Unix.file_perm -> ?fsync:bool -> string -> Core.Std.String.t Core.Std.List.t -> unit Import.Deferred.t
val save_sexp : ?temp_file:string -> ?perm:Unix.file_perm -> ?fsync:bool -> ?hum:bool -> string -> Core.Std.Sexp.t -> unit Import.Deferred.t
val save_sexps : ?temp_file:string -> ?perm:Unix.file_perm -> ?fsync:bool -> ?hum:bool -> string -> Core.Std.Sexp.t Core.Std.List.t -> unit Import.Deferred.t
val with_flushed_at_close : t -> flushed:(unit -> unit Import.Deferred.t) -> f:(unit -> 'a Import.Monitor.Deferred.t) -> 'a Import.Monitor.Deferred.t
val make_transfer : ?stop:unit Import.Deferred.t -> ?max_num_values_per_read:int -> t -> 'a Import.Pipe.Reader.t -> ('a Core_kernel.Std.Queue.t -> cont:(unit -> unit) -> unit) -> unit Import.Monitor.Deferred.t
val transfer : ?stop:unit Import.Deferred.t -> ?max_num_values_per_read:int -> t -> 'a Import.Pipe.Reader.t -> ('a -> unit) -> unit Import.Monitor.Deferred.t
val transfer' : ?stop:unit Import.Deferred.t -> ?max_num_values_per_read:int -> t -> 'a Import.Pipe.Reader.t -> ('a Core_kernel.Std.Queue.t -> unit Import.Deferred.t) -> unit Import.Monitor.Deferred.t