Verk.RetrySet

This module interacts with jobs in the retry set

Summary

add!(job, failed_at, redis \\ Verk.Redis)

Adds a job to the retry set ordering by timestamp, raising if there’s an error

add(job, failed_at, redis \\ Verk.Redis)

Adds a job to the retry set ordering by timestamp

clear!(redis \\ Verk.Redis)

Clears the retry set, raising if there’s an error

clear(redis \\ Verk.Redis)

Clears the retry set

count!(redis \\ Verk.Redis)

Counts how many jobs are inside the retry set, raising if there’s an error

count(redis \\ Verk.Redis)

Counts how many jobs are inside the retry set

delete_job!(original_json, redis \\ Verk.Redis)

Delete the job from the retry set, raising if there’s an error

delete_job(original_json, redis \\ Verk.Redis)

Delete the job from the retry set

key()

Redis retry set key

range!(start \\ 0, stop \\ -1, redis \\ Verk.Redis)

List jobs from start to stop, raising if there’s an error

range(start \\ 0, stop \\ -1, redis \\ Verk.Redis)

List jobs from start to stop

Functions

add(job, failed_at, redis \\ Verk.Redis)

Specs:

  • add(%Verk.Job{args: term, class: term, enqueued_at: term, error_backtrace: term, error_message: term, failed_at: term, finished_at: term, jid: term, original_json: term, queue: term, retried_at: term, retry_count: term}, integer, GenServer.server) :: :ok | {:error, Redix.Error.t}

Adds a job to the retry set ordering by timestamp

Optionally a redis connection can be specified

add!(job, failed_at, redis \\ Verk.Redis)

Specs:

  • add!(%Verk.Job{args: term, class: term, enqueued_at: term, error_backtrace: term, error_message: term, failed_at: term, finished_at: term, jid: term, original_json: term, queue: term, retried_at: term, retry_count: term}, integer, GenServer.server) :: nil

Adds a job to the retry set ordering by timestamp, raising if there’s an error

Optionally a redis connection can be specified

clear(redis \\ Verk.Redis)

Specs:

Clears the retry set

It will return {:ok, true} if the retry set was cleared and {:ok, false} otherwise

An error tuple may be returned if Redis failed

clear!(redis \\ Verk.Redis)

Specs:

Clears the retry set, raising if there’s an error

It will return true if the retry set was cleared and false otherwise

count(redis \\ Verk.Redis)

Specs:

  • count(GenServer.Server) :: {:ok, integer} | {:error, Redix.Error.t}

Counts how many jobs are inside the retry set

count!(redis \\ Verk.Redis)

Specs:

  • count!(GenServer.Server) :: integer

Counts how many jobs are inside the retry set, raising if there’s an error

delete_job(original_json, redis \\ Verk.Redis)

Specs:

  • delete_job(%Verk.Job{args: term, class: term, enqueued_at: term, error_backtrace: term, error_message: term, failed_at: term, finished_at: term, jid: term, original_json: term, queue: term, retried_at: term, retry_count: term} | String.t, GenServer.server) :: {:ok, boolean} | {:error, Redix.Error.t}

Delete the job from the retry set

It returns {:ok, true} if the job was found and deleted Otherwise it returns `{:ok, false}``

An error tuple may be returned if Redis failed

delete_job!(original_json, redis \\ Verk.Redis)

Specs:

  • delete_job!(%Verk.Job{args: term, class: term, enqueued_at: term, error_backtrace: term, error_message: term, failed_at: term, finished_at: term, jid: term, original_json: term, queue: term, retried_at: term, retry_count: term} | String.t, GenServer.server) :: boolean

Delete the job from the retry set, raising if there’s an error

It returns true if the job was found and delete Otherwise it returns false

key()

Redis retry set key

range(start \\ 0, stop \\ -1, redis \\ Verk.Redis)

Specs:

  • range(integer, integer, GenServer.server) :: {:ok, [Verk.Job.T]} | {:error, Redix.Error.t}

List jobs from start to stop

range!(start \\ 0, stop \\ -1, redis \\ Verk.Redis)

Specs:

List jobs from start to stop, raising if there’s an error