Verk.SortedSet (Verk v1.7.2) View Source
This module interacts with the jobs on a sorted set.
Link to this section 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.
Link to this section Functions
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.
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.
Specs
count(String.t(), GenServer.server()) :: {:ok, integer()} | {:error, Redix.Error.t()}
Counts how many jobs are inside the sorted set.
Specs
count!(String.t(), GenServer.server()) :: integer()
Counts how many jobs are inside the sorted set, raising if there's an error.
Specs
delete_job( String.t(), %Verk.Job{ args: term(), class: term(), created_at: 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.
Specs
delete_job!( String.t(), %Verk.Job{ args: term(), class: term(), created_at: 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
.
Specs
range(String.t(), integer(), integer(), GenServer.server()) :: {:ok, [Verk.Job.T]} | {:error, Redix.Error.t()}
Lists jobs from start
to stop
.
Specs
range!(String.t(), integer(), integer(), GenServer.server()) :: nil
Lists jobs from start
to stop
, raising if there's an error.
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.
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.
Specs
requeue_job( String.t(), %Verk.Job{ args: term(), class: term(), created_at: 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.
Specs
requeue_job!( String.t(), %Verk.Job{ args: term(), class: term(), created_at: 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
.