No commit activity in last 3 years
No release in over 3 years
Azure Queue backend for delayed_job
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
~> 2.0.1
~> 3.12
>= 2.0

Runtime

~> 0.6
~> 3.0.0
 Project Readme

This is Azure Queues backend for delayed_job

Getting Started

Get credentials

To start using delayed_job_azure, will need to have your storage account setup as mentioned here.

Once your account is setup, you will need to configure your access using one of the methods mentioned on https://github.com/Azure/azure-sdk-for-ruby/.

Installation

Add the gems to your Gemfile:

gem 'azure'
gem 'delayed_job'
gem 'delayed_job_azure'

Optionally: Add an initializer (config/initializers/delayed_job.rb):

Delayed::Worker.configure do |config|
  # optional params:
  config.available_priorities = [-1,0,1,2] # Default is [0]. Please note, adding new priorities will slow down picking the next job from queue.  Also note that these priorities must include all priorities of your Delayed Jobs.
  config.queue_name = 'default' # Specify an alternative queue name
  config.delay = 0  # Time to wait before message will be available on the queue
  config.timeout = 5.minutes # The time in seconds to wait after message is taken off the queue, before it is put back on. Delete before :timeout to ensure it does not go back on the queue.
  config.expires_in = 7.days # After this time, message will be automatically removed from the queue.
end

Usage

That's it. Use delayed_job as normal.

Example:

class User
  def background_stuff
    puts "I run in the background"
  end
end

Then in one of your controllers:

user = User.new
user.delay.background_stuff

Start worker process

rake jobs:work

That will start pulling jobs off the queue and processing them.

Documentation

You can find more documentation here: