Oban.Storage

oban · API reference

Persist bounded queries and conditional lifecycle transitions.

type row_ref = {
  id : Job.id;
  revision : int64;
}
type cursor = Job.id
type filter = {
  queue : Job.queue option;
  worker : Job.worker_name option;
  states : Job.state list;
  tags : Job.tag list;
}
type page = {
  jobs : Job.packed list;
  next : cursor option;
}
type enqueue_request = 
  | Standard of Job.spec
  | Unique of Job.spec
type enqueue = 
  | Inserted of Job.available Job.t
  | Existing of Job.packed
type write = 
  | Applied of Job.packed
  | Stale of Job.packed option
  | Invalid_state of Job.state
type finish = 
  | Complete
  | Fail of {
    kind : string;
    error : string;
    retry_at : Ptime.t;
  }
  | Cancel of string
  | Snooze of Ptime.t
type settings = {
  max_batch_size : int;
  max_page_size : int;
  max_maintenance_batch_size : int;
  sqlite_busy_timeout_ms : int;
  mariadb_migration_lock_timeout_seconds : int;
}

Operational safety bounds. Positive size fields may be raised explicitly; database parameter and transaction limits still apply.

val default_settings : settings
module Durable (D : Repodb.Driver.S) : sig ... end