package sihl

  1. Overview
  2. Docs
exception Exception of string
type instance_status =
  1. | Pending
  2. | Succeeded
  3. | Failed
  4. | Cancelled
val pp_instance_status : Ppx_deriving_runtime.Format.formatter -> instance_status -> Ppx_deriving_runtime.unit
val show_instance_status : instance_status -> Ppx_deriving_runtime.string
type instance = {
  1. id : string;
  2. name : string;
  3. input : string;
  4. tries : int;
  5. next_run_at : Ptime.t;
  6. max_tries : int;
  7. status : instance_status;
  8. last_error : string option;
  9. last_error_at : Ptime.t option;
}
val pp_instance : Ppx_deriving_runtime.Format.formatter -> instance -> Ppx_deriving_runtime.unit
val show_instance : instance -> Ppx_deriving_runtime.string
type 'a job = {
  1. name : string;
  2. encode : 'a -> string;
  3. decode : string -> ('a, string) Result.t;
  4. handle : 'a -> (unit, string) Result.t Lwt.t;
  5. failed : string -> instance -> unit Lwt.t;
  6. max_tries : int;
  7. retry_delay : Ptime.Span.t;
}
val pp_job : 'a. (Ppx_deriving_runtime.Format.formatter -> 'a -> Ppx_deriving_runtime.unit) -> Ppx_deriving_runtime.Format.formatter -> 'a job -> Ppx_deriving_runtime.unit
val show_job : 'a. (Ppx_deriving_runtime.Format.formatter -> 'a -> Ppx_deriving_runtime.unit) -> 'a job -> Ppx_deriving_runtime.string
type job' = {
  1. name : string;
  2. handle : string -> (unit, string) Result.t Lwt.t;
  3. failed : string -> instance -> unit Lwt.t;
  4. max_tries : int;
  5. retry_delay : Ptime.Span.t;
}
val pp_job' : Ppx_deriving_runtime.Format.formatter -> job' -> Ppx_deriving_runtime.unit
val show_job' : job' -> Ppx_deriving_runtime.string
val hide : 'a job -> job'
val should_run : instance -> Ptime.t -> bool
val default_tries : int
val default_retry_delay : Ptime.span
val default_error_handler : string -> instance -> unit Lwt.t
val create_job : ('a -> (unit, string) Result.t Lwt.t) -> ?max_tries:int -> ?retry_delay:Ptime.Span.t -> ?failed:(string -> instance -> unit Lwt.t) -> ('a -> string) -> (string -> ('a, string) Result.t) -> string -> 'a job
val name : string
module type Sig = sig ... end
OCaml

Innovation. Community. Security.