This example makes use of worker configuration file in order to tell the worker to process two queues (
mundane) instead of the
Note that the same can also be achieved through the command line, without using a config file.
# config/worker.yml :concurrency: 2 :queues: - critical - default - mundane
# jobs/critical.rb class Critical < Jobly::Job options queue: 'critical' def execute logger.info "Running a critical job" end end
# jobs/mundane.rb class Mundane < Jobly::Job options queue: 'mundane' def execute logger.info "Running a mundane job" end end
# Procfile web: jobly server worker: jobly worker --config worker
cd examples/worker-config # Start the server and worker # Note that the `Procfile` is defined to run `jobly worker --config worker` # which points the worker to the `config/worker.yml` configuration file foreman start # From another terminal, send the jobs to the owrker jobly send Critical jobly send Mundane