Verk v1.4.1 Verk

Verk is a job processing system that integrates well with Sidekiq jobs

Each queue will have a pool of workers handled by poolboy that will process jobs.

Verk has a retry mechanism similar to Sidekiq that keeps retrying the jobs with a reasonable backoff.

It has an API that provides information about the queues

Link to this section Summary

Functions

Add a new queue with a pool of size size of workers

Enqueues a Job to the specified queue returning the respective job id

Remove queue from the list of queues that are being processed

Schedules a Job to the specified queue returning the respective job id

Link to this section Functions

Link to this function add_queue(queue, size \\ 25)
add_queue(atom, pos_integer) :: Supervisor.on_start_child

Add a new queue with a pool of size size of workers

Link to this function enqueue(job, redis \\ Verk.Redis)
enqueue(%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}, GenServer.server) ::
  {:ok, binary} |
  {:error, term}

Enqueues a Job to the specified queue returning the respective job id

The job must have:

  • a valid queue
  • a list of args to perform
  • a module to perform (class)
  • a valid jid

Optionally a Redix server can be passed which defaults to Verk.Redis

Link to this function pause_queue(queue)
Link to this function remove_queue(queue)
remove_queue(atom) :: :ok | {:error, :not_found}

Remove queue from the list of queues that are being processed

Link to this function resume_queue(queue)
Link to this function schedule(job, datetime, redis \\ Verk.Redis)
schedule(%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}, %DateTime{calendar: term, day: term, hour: term, microsecond: term, minute: term, month: term, second: term, std_offset: term, time_zone: term, utc_offset: term, year: term, zone_abbr: term}, GenServer.server) ::
  {:ok, binary} |
  {:error, term}

Schedules a Job to the specified queue returning the respective job id

The job must have:

  • a valid queue
  • a list of args to perform
  • a module to perform (class)
  • a valid jid

Optionally a Redix server can be passed which defaults to Verk.Redis