Module: SidekiqBackgrounder

Defined in:
lib/sidekiq_backgrounder.rb,
lib/sidekiq_backgrounder/version.rb

Defined Under Namespace

Classes: Configuration, Error, Worker

Constant Summary collapse

VERSION =
"0.1.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



65
66
67
# File 'lib/sidekiq_backgrounder.rb', line 65

def configuration
  @configuration
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:



83
84
85
86
# File 'lib/sidekiq_backgrounder.rb', line 83

def configure
  self.configuration ||= Configuration.new
  yield(configuration)
end

.queue(options = {}) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/sidekiq_backgrounder.rb', line 67

def queue(options = {})
  c = SidekiqBackgrounder.configuration
  options.symbolize_keys!

  opts = %i(queue retry backtrace).inject({}) do |m, opt|
    m[opt] = c.public_send(opt)
    m[opt] = options[opt] if options.has_key?(opt)
    m
  end

  opts[:pool] = c.pool if c.pool.present?
  opts[:pool] = options[:pool] if options.has_key?(:pool).present?

  Worker.set(opts)
end