Options for Jobs - nsweeting/qpush GitHub Wiki

The following options are available when queuing a job. The only one that is required is 'klass'.

####klass The full name of the job class (with modules) you would like to use - in string format. For example:

klass: 'Jobs::MyJob'

####args The arguments you would like to provide for the job during initialization. This must be in hash format. For example:

args: { name: 'Bill', email: '[email protected]' }

The job above must be able to accept a hash during its initialization.

####priority The priority of the job. By default, QPush provides 5 levels of priority, with 1 being the highest, and 5 being the lowest. You can add different levels of priority through the server configuration. This must be an integer. The default priority is 3. For example:

priority: 1

####namespace The namespace to place this job under. Only the servers that are operating under this namespace will be able to pick the job up. The default namespace is 'default'. This must be a string. For example:

namespace: 'mail'

####start_at If you do not wish to run the job immediately, you can set a start time. The job will be queued in the delay pool until its start time. The start time must be in unix time format. For example, we could run a job in an hour from now:

start_at: Time.now.to_i + 3600

####cron If you would like to run the job at repeated intervals, we can provide the job with a cron expression. This must be in string format. For example, we could run a job every minute:

cron: '* * * * *'

####retry_max We can set the max number of retries that our job will perform if it fails. The default max is 10. Must be in integer format. For example:

retry_max: 5