package sihl

  1. Overview
  2. Docs

Module Sihl.QueueSource

include module type of struct include Sihl_facade.Queue end
Sourceval to_sexp : 'a Sihl_contract.Queue.t -> Sexplib0.Sexp.t
Sourceval default_tries : int
Sourceval default_retry_delay : Sihl_core.Time.duration
Sourceval create : name:string -> input_to_string:('a -> string option) -> string_to_input:(string option -> ('a, string) result) -> handle:('a -> (unit, string) result Lwt.t) -> ?failed:(string -> (unit, string) Lwt_result.t) -> unit -> 'a Sihl_contract.Queue.t
Sourceval set_max_tries : int -> 'a Sihl_contract.Queue.t -> 'a Sihl_contract.Queue.t
include Sihl_contract.Queue.Sig
Sourceval dispatch : 'a Sihl_contract.Queue.t -> ?delay:Sihl_core.Time.duration -> 'a -> unit Lwt.t

dispatch job ?delay input queues job for processing while input input is the input that the job needs to run. Use delay to run the job earliest after a certain amount of time.

Sourceval register_jobs : 'a Sihl_contract.Queue.t list -> unit Lwt.t

register_jobs jobs registers jobs that can be dispatched.

Only registered jobs can be dispatched. Dispatching a job that was not registered does nothing.

Sourcemodule Setup : sig ... end