Class: SidekiqScheduler::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq-scheduler/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(sidekiq_config: nil, without_defaults: false) ⇒ Config

We have to set the default as nil because the scheduler could be instantiated without passing the sidekiq config, and in those scenarios we don’t want to fail



5
6
7
8
# File 'lib/sidekiq-scheduler/config.rb', line 5

def initialize(sidekiq_config: nil, without_defaults: false)
  @sidekiq_config = sidekiq_config
  @scheduler_config = fetch_scheduler_config(sidekiq_config, without_defaults)
end

Instance Method Details

#dynamic=(value) ⇒ Object



22
23
24
# File 'lib/sidekiq-scheduler/config.rb', line 22

def dynamic=(value)
  scheduler_config[:dynamic] = value
end

#dynamic?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/sidekiq-scheduler/config.rb', line 18

def dynamic?
  scheduler_config[:dynamic]
end

#dynamic_every=(value) ⇒ Object



30
31
32
# File 'lib/sidekiq-scheduler/config.rb', line 30

def dynamic_every=(value)
  scheduler_config[:dynamic_every] = value
end

#dynamic_every?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/sidekiq-scheduler/config.rb', line 26

def dynamic_every?
  scheduler_config[:dynamic_every]
end

#enabled=(value) ⇒ Object



14
15
16
# File 'lib/sidekiq-scheduler/config.rb', line 14

def enabled=(value)
  scheduler_config[:enabled] = value
end

#enabled?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/sidekiq-scheduler/config.rb', line 10

def enabled?
  scheduler_config[:enabled]
end

#listened_queues_only=(value) ⇒ Object



46
47
48
# File 'lib/sidekiq-scheduler/config.rb', line 46

def listened_queues_only=(value)
  scheduler_config[:listened_queues_only] = value
end

#listened_queues_only?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/sidekiq-scheduler/config.rb', line 42

def listened_queues_only?
  scheduler_config[:listened_queues_only]
end

#rufus_scheduler_optionsObject



50
51
52
# File 'lib/sidekiq-scheduler/config.rb', line 50

def rufus_scheduler_options
  scheduler_config[:rufus_scheduler_options]
end

#rufus_scheduler_options=(value) ⇒ Object



54
55
56
# File 'lib/sidekiq-scheduler/config.rb', line 54

def rufus_scheduler_options=(value)
  scheduler_config[:rufus_scheduler_options] = value
end

#scheduleObject



34
35
36
# File 'lib/sidekiq-scheduler/config.rb', line 34

def schedule
  scheduler_config[:schedule]
end

#schedule=(value) ⇒ Object



38
39
40
# File 'lib/sidekiq-scheduler/config.rb', line 38

def schedule=(value)
  scheduler_config[:schedule] = value
end

#sidekiq_queuesObject



58
59
60
# File 'lib/sidekiq-scheduler/config.rb', line 58

def sidekiq_queues
  SidekiqScheduler::SidekiqAdapter.sidekiq_queues(sidekiq_config)
end