Module: ActiveJob::Plugins::Resque::Solo::ClassMethods
- Defined in:
- lib/active_job/plugins/resque/solo.rb
Instance Method Summary collapse
- #solo_any_args ⇒ Object
- #solo_except_args(*args) ⇒ Object
- #solo_inspector ⇒ Object
- #solo_lock_key_prefix(key_prefix) ⇒ Object
- #solo_only_args(*args) ⇒ Object
- #solo_self_enqueueing(setting) ⇒ Object
Instance Method Details
#solo_any_args ⇒ Object
17 18 19 |
# File 'lib/active_job/plugins/resque/solo.rb', line 17 def solo_any_args @solo_any_args = true end |
#solo_except_args(*args) ⇒ Object
26 27 28 29 |
# File 'lib/active_job/plugins/resque/solo.rb', line 26 def solo_except_args(*args) @solo_except_args = args.compact.map(&:to_s).uniq raise ArgumentError, "solo_except_args requires one or more field names" if @solo_except_args.empty? end |
#solo_inspector ⇒ Object
31 32 33 |
# File 'lib/active_job/plugins/resque/solo.rb', line 31 def solo_inspector @solo_inspector ||= Inspector.new(@solo_any_args, @solo_only_args, @solo_except_args, @solo_lock_key_prefix, @solo_self_enqueueing) end |
#solo_lock_key_prefix(key_prefix) ⇒ Object
35 36 37 38 39 |
# File 'lib/active_job/plugins/resque/solo.rb', line 35 def solo_lock_key_prefix(key_prefix) @solo_lock_key_prefix = key_prefix.strip raise ArgumentError, "solo_lock_key_prefix cannot be blank or only spaces." if @solo_lock_key_prefix.blank? end |
#solo_only_args(*args) ⇒ Object
21 22 23 24 |
# File 'lib/active_job/plugins/resque/solo.rb', line 21 def solo_only_args(*args) @solo_only_args = args.compact.map(&:to_s).uniq raise ArgumentError, "solo_only_args requires one or more field names" if @solo_only_args.empty? end |
#solo_self_enqueueing(setting) ⇒ Object
41 42 43 44 |
# File 'lib/active_job/plugins/resque/solo.rb', line 41 def solo_self_enqueueing(setting) raise ArgumentError, "solo_self_enqueueing may only be set to :allow or :prevent." unless [:allow, :prevent].include?(setting) @solo_self_enqueueing = (setting == :allow) end |