Verk v0.13.4 Verk.SortedSet

This module interacts with the jobs on a sorted set

Summary

Functions

Clears the sorted set

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

Counts how many jobs are inside the sorted set

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

Deletes the job from the sorted set

Deletes the job from the sorted set, raising if there’s an error

Lists jobs from start to stop

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

Lists jobs from start to stop along with the item scores

Lists jobs from start to stop along with the item scores, raising if there’s an error

Moves the job from the sorted set back to its original queue

Moves the job from the sorted set back to its original queue, raising if there’s an error

Functions

clear(key, redis)

Specs

clear(String.t, GenServer.server) ::
  {:ok, boolean} |
  {:error, Redix.Error.t}

Clears the sorted set

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

An error tuple may be returned if Redis failed

clear!(key, redis)

Specs

clear!(String.t, GenServer.server) :: boolean

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

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

count(key, redis)

Specs

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

Counts how many jobs are inside the sorted set

count!(key, redis)

Specs

count!(String.t, GenServer.server) :: integer

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

delete_job(key, original_json, redis)

Specs

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

Deletes the job from the sorted 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!(key, original_json, redis)

Specs

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

Deletes the job from the sorted set, raising if there’s an error

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

range(key, start \\ 0, stop \\ -1, redis)

Specs

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

Lists jobs from start to stop

range!(key, start \\ 0, stop \\ -1, redis)

Specs

range!(String.t, integer, integer, GenServer.server) :: nil

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

range_with_score(key, start \\ 0, stop \\ -1, redis)

Specs

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

Lists jobs from start to stop along with the item scores

range_with_score!(key, start \\ 0, stop \\ -1, redis)

Specs

range_with_score!(String.t, integer, integer, GenServer.server) :: nil

Lists jobs from start to stop along with the item scores, raising if there’s an error

requeue_job(key, original_json, redis)

Specs

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

Moves the job from the sorted set back to its original queue

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

An error tuple may be returned if Redis failed

requeue_job!(key, original_json, redis)

Specs

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

Moves the job from the sorted set back to its original queue, raising if there’s an error

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