Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Next Gen Ruby gem for IronWorker
Ruby Shell PHP JavaScript Python Java

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
sample
.document
.gitignore
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile
VERSION
iron_worker_ng.gemspec

README.md

Basic Usage

Visit http://iron.io for more details.

Create Worker

You can just put any code into worker or can create class with name matching file name (e.g MyWorker class in my_worker.rb) and run method.

require 'active_record'

# @params hash is available here
# do something fun

Create Runner

require 'iron_worker_ng'

client = IronWorkerNG::Client.new('IRON_IO_TOKEN', 'IRON_IO_PROJECT_ID')

code = IronWorkerNG::Code::Ruby.new
code.merge_worker 'path/to/my_worker.rb'
code.merge_gem 'activerecord'

# you can use hash_string to check if you need to reupload code
# note that hash_string check is fast while code upload can take a while (depends on how much things you merged)
puts code.hash_string

client.codes.create(code)

client.tasks.create('MyWorker', 'foo' => 'bar')
Something went wrong with that request. Please try again.