Verk v0.13.4 Verk.Queue

This module interacts with a queue

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

Functions

clear(queue)

Specs

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)

Specs

clear!(binary) :: boolean

Clears the queue, raising if there’s an error

It will return true if the queue was cleared and false otherwise

count(queue)

Specs

count(binary) ::
  {:ok, integer} |
  {:error, atom | Redix.Error.t}

Counts how many jobs are enqueued on a queue

count!(queue)

Specs

count!(binary) :: integer

Counts how many jobs are enqueued on a queue, raising if there’s an error

delete_job(queue, original_json)

Specs

delete_job(binary, %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} | 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)

Specs

delete_job!(binary, %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} | 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)

Specs

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)

Specs

range!(binary, integer, integer) :: [Verk.Job.T]

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