FanSQS
FanSQS is a background job processing engine for Ruby using AWS SQS for message storage.
Installation
Add this line to your application's Gemfile:
gem 'FanSQS'
And then execute:
$ bundle
Or install it yourself as:
$ gem install FanSQS
Rails Setup
Create a config/initializer.rb file in your application directory and insert this line:
AWS.config( access_key_id: '<your_access_key_id>', secret_access_key: '<your_secret_access_key>')
Usage
FanSQS integrates seemlessly with your Rails applications. Just include the module FanSQS::Worker in the class that encapsulates your job logic and define a class method called perform. The method perform should be able to accept any number of parameters of any type.
class MessagePublisher
include FanSQS::Worker
set_fan_sqs_options queue: :message_queue
def self.perform(arg1, arg2, ...)
end
end
To push jobs into an SQS queue for processing, simply call:
MessagePublisher.perform_async(arg1, arg2, ...)
Features to add
- Rake task to start poller
- Priority queues
- Auto retries on error
- Hook up to Travis
Contributing
- Fork it ( http://github.com//FanSQS/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Test coverage for your changes. Sorry I will not merge changes without test coverage!
- Push to the branch (
git push origin my-new-feature
) - Create new Pull Request