package sihl

  1. Overview
  2. Docs

Module Contract.QueueSource

Sourceexception Exception of string
Sourcetype instance_status =
  1. | Pending
  2. | Succeeded
  3. | Failed
  4. | Cancelled
Sourcetype 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;
}
Sourcetype '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;
}
Sourcetype 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;
}
Sourceval hide : 'a job -> job'
Sourceval should_run : instance -> Ptime.t -> bool
Sourceval default_tries : int
Sourceval default_retry_delay : Ptime.span
Sourceval default_error_handler : string -> instance -> unit Lwt.t
Sourceval 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
Sourceval name : string
Sourcemodule type Sig = sig ... end
OCaml

Innovation. Community. Security.