Class: Sidekiq::Tasks::Config

Inherits:
Object
  • Object
show all
Includes:
Validations
Defined in:
lib/sidekiq/tasks/config.rb

Constant Summary collapse

DEFAULT_SIDEKIQ_OPTIONS =
{
  queue: "default",
  retry: false,
}.freeze
DEFAULT_STRATEGIES =
[
  Sidekiq::Tasks::Strategies::RakeTask.new(
    rules: [
      Sidekiq::Tasks::Strategies::Rules::TaskFromLib.new,
      Sidekiq::Tasks::Strategies::Rules::EnableWithComment.new,
    ]
  ),
].freeze
DEFAULT_STORAGE =
Sidekiq::Tasks::Storage::Redis
DEFAULT_HISTORY_LIMIT =
10

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validations

validate_array_classes!, validate_class!, validate_expected_values!, validate_hash_option!, validate_subclass!

Constructor Details

#initializeConfig

Returns a new instance of Config.



26
27
28
29
30
31
32
33
# File 'lib/sidekiq/tasks/config.rb', line 26

def initialize
  @sidekiq_options = DEFAULT_SIDEKIQ_OPTIONS
  @strategies = DEFAULT_STRATEGIES
  @storage = DEFAULT_STORAGE
  @authorization = ->(_env) { true }
  @history_limit = DEFAULT_HISTORY_LIMIT
  @current_user = nil
end

Instance Attribute Details

#authorizationObject

Returns the value of attribute authorization.



24
25
26
# File 'lib/sidekiq/tasks/config.rb', line 24

def authorization
  @authorization
end

#current_userObject

Returns the value of attribute current_user.



24
25
26
# File 'lib/sidekiq/tasks/config.rb', line 24

def current_user
  @current_user
end

#history_limitObject

Returns the value of attribute history_limit.



24
25
26
# File 'lib/sidekiq/tasks/config.rb', line 24

def history_limit
  @history_limit
end

#sidekiq_optionsObject

Returns the value of attribute sidekiq_options.



24
25
26
# File 'lib/sidekiq/tasks/config.rb', line 24

def sidekiq_options
  @sidekiq_options
end

#storageObject

Returns the value of attribute storage.



24
25
26
# File 'lib/sidekiq/tasks/config.rb', line 24

def storage
  @storage
end

#strategiesObject

Returns the value of attribute strategies.



24
25
26
# File 'lib/sidekiq/tasks/config.rb', line 24

def strategies
  @strategies
end