rainforestapp/rake-multiple

Name: rake-multiple

Owner: Rainforest QA

Description: Run a rake task in multiple processes.

Created: 2015-02-17 21:05:54.0

Updated: 2015-02-17 21:35:40.0

Pushed: 2015-02-17 21:35:40.0

Homepage: null

Size: 128

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Rake::Multiple

Rake::Multiple is the easiest way to run the same Rake task in multiple forked processes. It's particularly useful if your app is hosted on a PaaS provider, such as Heroku, and you want to run multiple worker processes by container, saving money.

Installation

Add this line to your application's Gemfile:

'rake-multiple'

And then execute:

$ bundle
Usage

Rake::Multiple can invoke any task by prefixing the multiple namespace to the task. So if you're running:

 jobs:work

You can then run two processes in your app with the following command:

IPLE_WORKER_COUNT=2 rake multiple:jobs:work

If your tasks need has dependencies, you can run a specific dependency by using the MULTIPLE_EXECUTE_TASK variable.

IPLE_WORKER_COUNT=2 MULTIPLE_EXECUTE_TASK=environment rake multiple:jobs:work
Contributing
  1. Fork it ( https://github.com/[my-github-username]/rake-multiple/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.