Given the following Procfile:
# /tmp/Procfile.example
web: bundle exec puma -C ./config/puma.rb
# Resque Scheduler
resque_scheduler: env TERM_CHILD=1 RESQUE_TERM_TIMEOUT=10 bundle exec rake environment resque:scheduler
# RabbitMQ message consumption
foo_processor: env USE_SHARED_DB=true JOB_KLASS=FooJob QUEUE_NAME=foo_jobs bundle exec rake rabbitmq_to_resque_reader BINDING_KEYS='meta.foo.#'
bar_processor: env USE_SHARED_DB=true QUEUE_NAME=bar_jobs JOB_KLASS=BarJob bundle exec rake rabbitmq_to_resque_reader BINDING_KEYS='meta.bar.#'
# Resque worker processes
foo_worker: env bundle exec rake environment resqutils:work QUEUE=foo_jobs RESQUE_TERM_TIMEOUT=60 TERM_CHILD=1 USE_DATABASE=false
bar_worker: env bundle exec rake environment resqutils:work QUEUE=bar_jobs TERM_CHILD=1 USE_DATABASE=false RESQUE_TERM_TIMEOUT=60
When you run the following command:
$ cat /tmp/Procfile.example | ./formatter.rb
...you will see the following output:
# /tmp/Procfile.example
web: bundle exec puma -C ./config/puma.rb
# Resque Scheduler
resque_scheduler: env bundle exec rake environment resque:scheduler RESQUE_TERM_TIMEOUT=10 TERM_CHILD=1
# RabbitMQ message consumption
foo_processor: env bundle exec rake rabbitmq_to_resque_reader BINDING_KEYS='meta.foo.#' JOB_KLASS=FooJob QUEUE_NAME=foo_jobs USE_SHARED_DB=true
bar_processor: env bundle exec rake rabbitmq_to_resque_reader BINDING_KEYS='meta.bar.#' JOB_KLASS=BarJob QUEUE_NAME=bar_jobs USE_SHARED_DB=true
# Resque worker processes
foo_worker: env bundle exec rake environment resqutils:work QUEUE=foo_jobs RESQUE_TERM_TIMEOUT=60 TERM_CHILD=1 USE_DATABASE=false
bar_worker: env bundle exec rake environment resqutils:work QUEUE=bar_jobs RESQUE_TERM_TIMEOUT=60 TERM_CHILD=1 USE_DATABASE=false