Method: Chore::Job::ClassMethods#queue_options
- Defined in:
- lib/chore/job.rb
#queue_options(opts = {}) ⇒ Object
Pass a hash of options to queue_options the included class’s use of Chore::Job opts has just the one required option.
-
:name: which should map to the name of the queue this job should be published to.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/chore/job.rb', line 49 def (opts = {}) = ( || DEFAULT_OPTIONS).merge(opts_from_cli).merge(opts) .each do |k| raise ArgumentError.new("#{self.to_s} :#{k} is a required option for Chore::Job") unless [k] end if .key?(:backoff) if ![:backoff].is_a?(Proc) raise ArgumentError, "#{self.to_s}: backoff must be a lambda or Proc" elsif [:backoff].arity != 1 raise ArgumentError, "#{self.to_s}: backoff must accept a single argument" end end if .key?(:dedupe_lambda) if ![:dedupe_lambda].is_a?(Proc) raise ArgumentError, "#{self.to_s}: dedupe_lambda must be a lambda or Proc" end end end |