Module Observe_fs_lwt_unix

Ready daily NDJSON files for Observe applications using Lwt-Unix.

type operation =
  1. | Inspect
  2. | Create_directory
  3. | Open
  4. | Write
  5. | Close
type error =
  1. | Invalid_directory
  2. | Invalid_capacity of int
  3. | Filesystem of {
    1. operation : operation;
    2. path : string;
    3. cause : Unix.error;
    }
  4. | Zero_progress
  5. | Invalid_write_count of int
  6. | Unexpected of exn
  7. | Lifecycle_closed
exception Error of error

Raised by create_exn.

val create : dir:string -> ?capacity:int -> unit -> (Observe.Drain.t, error) Stdlib.result Lwt.t

Prepare dir, start one bounded worker, join the ready lifecycle, and return the configured drain.

val create_exn : dir:string -> ?capacity:int -> unit -> Observe.Drain.t Lwt.t

Like create, but raise Error with the same typed failure.

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