Class: Sidekiqable::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiqable/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



7
8
9
10
11
12
13
14
15
# File 'lib/sidekiqable/configuration.rb', line 7

def initialize
  @queue = "default"
  @retry = true
  @dead = true
  @backtrace = false
  @pool = nil
  @tags = nil
  @validate_arguments = true
end

Instance Attribute Details

#backtraceObject

Returns the value of attribute backtrace.



5
6
7
# File 'lib/sidekiqable/configuration.rb', line 5

def backtrace
  @backtrace
end

#deadObject

Returns the value of attribute dead.



5
6
7
# File 'lib/sidekiqable/configuration.rb', line 5

def dead
  @dead
end

#poolObject

Returns the value of attribute pool.



5
6
7
# File 'lib/sidekiqable/configuration.rb', line 5

def pool
  @pool
end

#queueObject

Returns the value of attribute queue.



5
6
7
# File 'lib/sidekiqable/configuration.rb', line 5

def queue
  @queue
end

#retryObject

Returns the value of attribute retry.



5
6
7
# File 'lib/sidekiqable/configuration.rb', line 5

def retry
  @retry
end

#tagsObject

Returns the value of attribute tags.



5
6
7
# File 'lib/sidekiqable/configuration.rb', line 5

def tags
  @tags
end

#validate_argumentsObject

Returns the value of attribute validate_arguments.



5
6
7
# File 'lib/sidekiqable/configuration.rb', line 5

def validate_arguments
  @validate_arguments
end

Instance Method Details

#sidekiq_optionsObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/sidekiqable/configuration.rb', line 17

def sidekiq_options
  {}.tap do |opts|
    opts[:queue] = queue if queue
    opts[:retry] = @retry unless @retry.nil?
    opts[:dead] = dead unless dead.nil?
    opts[:backtrace] = backtrace unless backtrace.nil?
    opts[:pool] = pool if pool
    opts[:tags] = tags if tags
  end
end