Module: Funktor::Worker::FunktorOptions::ClassMethods

Defined in:
lib/funktor/worker/funktor_options.rb

Instance Method Summary collapse

Instance Method Details

#custom_queueObject



30
31
32
# File 'lib/funktor/worker/funktor_options.rb', line 30

def custom_queue
  get_funktor_options[:queue]
end

#custom_queue_urlObject



26
27
28
# File 'lib/funktor/worker/funktor_options.rb', line 26

def custom_queue_url
  get_funktor_options[:queue_url]
end

#custom_retry_limitObject



34
35
36
37
38
39
40
41
42
# File 'lib/funktor/worker/funktor_options.rb', line 34

def custom_retry_limit
  retry_limit = get_funktor_options[:retry]
  if retry_limit.nil?
    retry_limit = 25
  elsif !retry_limit # if someone did "retry: false"
    retry_limit = 0
  end
  return retry_limit
end

#funktor_options(options = {}) ⇒ Object



14
15
16
# File 'lib/funktor/worker/funktor_options.rb', line 14

def funktor_options(options = {})
  self.funktor_options_hash = options
end

#funktor_retry_in(&block) ⇒ Object



22
23
24
# File 'lib/funktor/worker/funktor_options.rb', line 22

def funktor_retry_in(&block)
  self.funktor_retry_in_block = block
end

#get_funktor_optionsObject



18
19
20
# File 'lib/funktor/worker/funktor_options.rb', line 18

def get_funktor_options
  self.funktor_options_hash || {}
end

#queue_urlObject



44
45
46
# File 'lib/funktor/worker/funktor_options.rb', line 44

def queue_url
  custom_queue_url
end

#work_queueObject



48
49
50
# File 'lib/funktor/worker/funktor_options.rb', line 48

def work_queue
  (self.custom_queue || 'default').to_s
end