Class: SidekiqScheduler::Config
- Inherits:
-
Object
- Object
- SidekiqScheduler::Config
- Defined in:
- lib/sidekiq-scheduler/config.rb
Instance Method Summary collapse
- #dynamic=(value) ⇒ Object
- #dynamic? ⇒ Boolean
- #dynamic_every=(value) ⇒ Object
- #dynamic_every? ⇒ Boolean
- #enabled=(value) ⇒ Object
- #enabled? ⇒ Boolean
-
#initialize(sidekiq_config: nil, without_defaults: false) ⇒ Config
constructor
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.
- #listened_queues_only=(value) ⇒ Object
- #listened_queues_only? ⇒ Boolean
- #rufus_scheduler_options ⇒ Object
- #rufus_scheduler_options=(value) ⇒ Object
- #schedule ⇒ Object
- #schedule=(value) ⇒ Object
- #sidekiq_queues ⇒ Object
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
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
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
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
42 43 44 |
# File 'lib/sidekiq-scheduler/config.rb', line 42 def listened_queues_only? scheduler_config[:listened_queues_only] end |
#rufus_scheduler_options ⇒ Object
50 51 52 |
# File 'lib/sidekiq-scheduler/config.rb', line 50 def scheduler_config[:rufus_scheduler_options] end |
#rufus_scheduler_options=(value) ⇒ Object
54 55 56 |
# File 'lib/sidekiq-scheduler/config.rb', line 54 def (value) scheduler_config[:rufus_scheduler_options] = value end |
#schedule ⇒ Object
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_queues ⇒ Object
58 59 60 |
# File 'lib/sidekiq-scheduler/config.rb', line 58 def sidekiq_queues SidekiqScheduler::SidekiqAdapter.sidekiq_queues(sidekiq_config) end |