Skip to content

Instantly share code, notes, and snippets.

@treeder
Created May 24, 2012 18:40
Show Gist options
  • Select an option

  • Save treeder/2783383 to your computer and use it in GitHub Desktop.

Select an option

Save treeder/2783383 to your computer and use it in GitHub Desktop.
For IronWorker CLI Blog Post
{
"token": "MY_TOKEN",
"project_id": "MY_PROJECT_ID"
}
# define the runtime language, this can be ruby, java, node, php, go, etc.
runtime "ruby"
# exec is the file that will be executed:
exec "hello_worker.rb"
# Worker code can be anything you want.
puts "Starting HelloWorker at #{Time.now}"
puts "Payload: #{params}"
puts "Simulating hard work for 5 seconds..."
5.times do |i|
puts "Sleep #{i}..."
sleep 1
end
puts "HelloWorker completed at #{Time.now}"
require "iron_worker_ng"
client = IronWorkerNG::Client.new
100.times do
client.tasks.create("hello", "foo"=>"bar")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment