Skip to content

Instantly share code, notes, and snippets.

@mcansky
Created March 8, 2012 20:41
Show Gist options
  • Select an option

  • Save mcansky/2003308 to your computer and use it in GitHub Desktop.

Select an option

Save mcansky/2003308 to your computer and use it in GitHub Desktop.
require "iron_worker_ng"
code = IronWorkerNG::Code::Ruby.new
code.merge_worker "#{Rails.root}/app/workers/test_iron.rb"
# ...and upload it to iron.io cloud
client = IronWorkerNG::Client.new(Settings.iron_worker.token, Settings.iron_worker.project_id)
client.codes.create(code)
# :host, :port, :ssl, :payload, :url, :token, :username
client.tasks.create('TestIron', 'foo' => 42)
client.schedule(:start_at => 30.seconds.since, :run_every => 300, :run_times => 5)
@mcansky
Copy link
Author

mcansky commented Mar 8, 2012

run times is optional

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment