Right now, the iron_worker_ruby_ng gem allows one to create tasks one at a time:
iron-worker client.tasks.create('MyWorker', {:client => 'Joe'})
Some scenarios require the creation of thousands of tasks. In this instance, it would be faster and more efficient if one could create many jobs at once:
client.tasks.create('MyWorker', [{:client => 'Joe'}, {:client => 'Bob'}, ..]) # batch of 100
--
I've forked the gem and made the changes but unfortunately the service endpoint returns 400. Is there any way to do this? If not, any chance this could be a feature?
def tasks_create_bulk(code_name, payloads, options = {})
payloads_arg = payloads.map do |payload|
{:code_name => code_name, :payload => payload}.merge(options)
end
parse_response(post("projects/#{@project_id}/tasks", {:tasks => payloads_arg}))
end
Thanks,
Dimitri