Afterparty

A Rails 4 compatible queue with support for executing jobs in the future and serialization with Redis.

Installation

Make sure you've installed redis on your machine.

Add this line to your application's Gemfile:

gem 'afterparty'

And then execute:

$ bundle

Or install it yourself as:

$ gem install afterparty

In your desired application environment, like application.rb:

config.queue = Afterparty::RedisQueue.new

Usage

A job is a ruby object with a run method.

class Job
  def run
    puts "Hello!"
  end
end

Then add it to the queue at any time.

Rails.queue << Job.new

If your job responds to an execute_at method, the queue will wait to process that job until the specified time.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Add a test in spec/redis_queue_spec.rb
  4. Make sure tests pass when you run rake
  5. Commit your changes (git commit -am 'Add some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create new Pull Request