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

Summary

add_queue(queue, size \\ 25)

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

enqueue(job, redis \\ Verk.Redis)

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

remove_queue(queue)

Remove queue from the list of queues that are being processed

schedule(job, datetime, redis \\ Verk.Redis)

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

Functions

add_queue(queue, size \\ 25)

Specs:

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

enqueue(job, redis \\ Verk.Redis)

Specs:

  • enqueue(%Verk.Job{args: term, class: term, enqueued_at: term, error_backtrace: term, error_message: term, failed_at: term, finished_at: term, jid: 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

remove_queue(queue)

Specs:

  • remove_queue(atom) :: :ok | {:error, :not_found}

Remove queue from the list of queues that are being processed

schedule(job, datetime, redis \\ Verk.Redis)

Specs:

  • schedule(%Verk.Job{args: term, class: term, enqueued_at: term, error_backtrace: term, error_message: term, failed_at: term, finished_at: term, jid: term, original_json: term, queue: term, retried_at: term, retry_count: term}, %Timex.DateTime{calendar: term, day: term, hour: term, millisecond: term, minute: term, month: term, second: term, timezone: term, year: 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