Oban.Worker

oban · API reference

Perform claimed jobs and choose their outcomes.

type outcome = 
  | Ok
  | Error of string
  | Cancel of string
  | Snooze of float
type timeout = 
  | Unlimited
  | After of float (* Positive finite clock seconds. *)
module type S = sig ... end
type packed = 
  | Pack : (module S) -> packed
val default_backoff : Job.executing Job.t -> float

Exponential backoff from 15 seconds, capped at one day.

val default_timeout : Job.executing Job.t -> timeout

Unlimited.

val pack : (module S) -> packed
val name : packed -> Job.worker_name
val perform : packed -> Job.executing Job.t -> outcome
val backoff : packed -> Job.executing Job.t -> float
val timeout : packed -> Job.executing Job.t -> timeout