Project

rails_iron

0.0
No commit activity in last 3 years
No release in over 3 years
To simplify integrating iron.io into Rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

RailsIron

Gem Version Build Status Code Climate Coverage Status Dependency Status

Process background tasks for Rails applications using IronWorker. The aim is to provide a Sidekiq compatible interface.

Installation

$ gem install rails_iron

Usage

Add a worker into your app/workers folder:

# app/workers/my_hard_worker.rb
require "rails_iron"

class MyHardWorker
  include RailsIron::Worker

  def perform
    10.times { "hard work" }
  end
end

The require "rails_iron" is necessary to boot your Iron.io worker.

Now go ahead and create a background task from within your application:

MyHardWorker.perform_async

You may also supply arguments to the worker:

# app/workers/my_hard_worker.rb
require "rails_iron"

class MyHardWorker
  include RailsIron::Worker

  def perform(work)
    puts "hard #{work}"
  end
end

MyHardWorker.perform_async("rock")

Todo

This library isn't finished yet, the following is still missing:

  • a Rake task for building and uploading the worker
  • documentation on how to supply ENV variables
  • a mechanism to catch Rails database timeouts during boot time

Testing

To run the tests:

$ rspec

Contributing

  1. Fork it.
  2. Create a branch (git checkout -b my_feature)
  3. Commit your changes (git commit -am "Added Feature")
  4. Push to the branch (git push origin my_feature)
  5. Open a Pull Request
  6. Enjoy a refreshing Diet Coke and wait

License

Please see LICENSE for licensing details.

Author

Harm-Jan Blok, http://sudoit.nl