Module Observe_fs.Make

Parameters

module IO : IO.S

Signature

type error =
  1. | Invalid_directory
  2. | Invalid_capacity of int
  3. | Io of IO.error
  4. | Zero_progress
  5. | Invalid_write_count of int
  6. | Unexpected of exn
type t
type delivery_facts =
  1. | No_problem
  2. | Rejected
  3. | Delivery_lost
  4. | Rejected_and_lost
val create : dir:string -> ?capacity:int -> unit -> (t, error) Stdlib.result IO.t

Prepare the directory and start one bounded background writer.

val drain : t -> Observe.Drain.t

The synchronous ownership-transfer boundary for application config. Full and closed writers reject before projection. Projections in progress reserve queue capacity until they commit or fail.

val delivery_facts : t -> delivery_facts

Return finite cumulative facts about rejected offers and accepted records later discarded by terminal delivery failure. This is observation of the writer's owned delivery state, not a persistence or durability claim.

val flush : t -> (unit, error) Stdlib.result IO.t

Flush every record accepted before the call.

val shutdown : t -> (unit, error) Stdlib.result IO.t

Stop acceptance, drain accepted records, flush, close, and stop.

val pp_error : Stdlib.Format.formatter -> error -> unit