This add-on is operated by Iron.io
Highly available and scalable task queue / worker service.
Last updated 20 February 2019
IronWorker is a massively scalable task queue/job queue that makes it easy for you offload front end tasks, run background jobs, and process many tasks at once – all in the cloud and with no servers to set up and manage. It can also function as a cron-in-the-cloud service, running tasks on a schedule you define.
IronWorker has partnered with Heroku to make using both services together even easier.
It’s quick and easy to get IronWorker set up and running on Heroku using your language of choice. Note that Ruby IronWorker currently requires Ruby 1.9 or later. Please check the Heroku documentation to find out whether your stack is supported and how to select a supported stack.
Once you have a stack selected, you need to install the IronWorker addon for Heroku. You can do this with a quick command:
$ heroku addons:create iron_worker -----> Adding iron_worker to strong-mountain-405... done, v29 (free)
This will add the developer level addon for IronWorker, which will let you test the addon and play around a bit. There are other levels of the addon, as well.
Install the iron_worker_ruby gem:
$ gem install iron_worker_ruby
Now that you’ve added the addon, you need to retrieve your token and project ID. The token functions as a password, so please keep it secure! Each app has a different project ID. You can get the token and project ID by running the following command:
$ heroku config | grep IRON IRON_WORKER_PROJECT_ID => 123456789 IRON_WORKER_TOKEN => aslkdjflaksuilaks
You can also get your token and project ID from the Iron.io HUD. To get to the Iron.io HUD, go to your apps panel for Heroku, choose your app, expand the addons drop-down, and click on IronWorker. This will bring you to the IronWorker HUD, where you can see your project ID and token listed.
You can now access the client like so, using the environment variables above:
client = IronWorker::Client.new(:token => 'IRON_WORKER_TOKEN', :project_id => 'IRON_WORKER_PROJECT_ID')
Now that you’ve instantiated the client, you can upload code, create new tasks, etc. Please reference the IronWorker Ruby Gem for more information.
When trying to troubleshoot a worker, the best first step is to try and run the worker locally. If the worker runs locally, it should run on the cloud. You can also access your worker logs through the Iron.io HUD. These logs will show you any errors thrown or debug messages you log while the worker is running.
The most common source of worker errors is a mismatch between your local environment and the cloud’s environment. Double-check your
Gemfile and your Ruby version – workers run under Ruby >1.9. Also, make sure your
Gemfile.lock has been updated. Run
bundle install to make sure.
Issues should get logged with Heroku Support. You’re also welcome to stop by the Iron.io support chat room and chat with Iron’s staff about issues. You can also find more resources and documentation on the Iron.io Dev Center.