Skip to content
This repository

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 rails
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.markdown
Octocat-spinner-32 Rakefile
Octocat-spinner-32 iron_worker.gemspec
README.markdown

Getting Started

Sign up for a IronWorker account, it's free to try!

WARNING: THIS GEM IS DEPRECATED. Use the generation IronWorker gem, iron_worker_ng, at: https://github.com/iron-io/iron_worker_ruby_ng. It also includes our new IronWorker command line interface (CLI) which is... awesome. ;) You can read more about that here.

Install IronWorker Gem

gem install iron_worker

Configure IronWorker

You really just need your token, which you can get here

IronWorker.configure do |config|
    config.token = TOKEN
    config.project_id = MY_PROJECT_ID
end

Write a Worker

Here's an example worker that sends an email:

require 'iron_worker'

class HelloWorker < IronWorker::Base

    attr_accessor :name

    # This is the method that will be run
    def run
        puts "Hello #{name}!"
    end
end

Test It Locally

Let's say someone does something in your app and you want to send an email about it.

worker = HelloWorker.new
worker.name = "Travis"
worker.run_local

Once you've got it working locally, the next step is to run it on the IronWorker cloud.

Queue up your Worker on the IronWorker Cloud

Let's say someone does something in your app and you want to send an email about it.

worker = HelloWorker.new
worker.name = "Travis"
worker.queue

This will send it off to the IronWorker cloud.

Full Documentation

Now that you've got your first worker running, be sure to check out the full documentation. IronWorker can do so much more!

And check out the Iron.io Dev Center for full IronWorker API documentation and and support for other languages.

Something went wrong with that request. Please try again.