Verk v1.7.1 Verk.Queue
This module interacts with a queue
Link to this section Summary
Functions
Clears the queue
Clears the queue
, raising if there's an error
Counts how many jobs are enqueued on a queue
Counts how many jobs are enqueued on a queue, raising if there's an error
Deletes the job from the queue
Delete job from the queue
, raising if there's an error
Lists enqueued jobs from start
to stop
Lists enqueued jobs from start
to stop
, raising if there's an error
Link to this section Functions
clear(queue)
clear(binary()) :: {:ok, boolean()} | {:error, Redix.Error.t()}
clear(binary()) :: {:ok, boolean()} | {:error, Redix.Error.t()}
Clears the queue
It will return {:ok, true}
if the queue
was cleared and {:ok, false}
otherwise
An error tuple may be returned if Redis failed
clear!(queue)
Clears the queue
, raising if there's an error
It will return true
if the queue
was cleared and false
otherwise
count(queue)
count(binary()) :: {:ok, integer()} | {:error, atom() | Redix.Error.t()}
count(binary()) :: {:ok, integer()} | {:error, atom() | Redix.Error.t()}
Counts how many jobs are enqueued on a queue
count!(queue)
Counts how many jobs are enqueued on a queue, raising if there's an error
delete_job(queue, original_json)
delete_job(
binary(),
%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()
}
| binary()
) :: {:ok, boolean()} | {:error, Redix.Error.t()}
delete_job( binary(), %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() } | binary() ) :: {:ok, boolean()} | {:error, Redix.Error.t()}
Deletes the job from the queue
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!(queue, original_json)
delete_job!(
binary(),
%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()
}
| binary()
) :: boolean()
delete_job!( binary(), %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() } | binary() ) :: boolean()
Delete job from the queue
, raising if there's an error
It returns true
if the job was found and delete
Otherwise it returns false
An error will be raised if Redis failed
range(queue, start \\ 0, stop \\ -1)
range(binary(), integer(), integer()) ::
{:ok, [Verk.Job.T]} | {:error, Redix.Error.t()}
range(binary(), integer(), integer()) :: {:ok, [Verk.Job.T]} | {:error, Redix.Error.t()}
Lists enqueued jobs from start
to stop
range!(queue, start \\ 0, stop \\ -1)
Lists enqueued jobs from start
to stop
, raising if there's an error