Class: RailsFastCache::Scheduler
- Inherits:
-
Object
- Object
- RailsFastCache::Scheduler
- Defined in:
- lib/rails-fast-cache/scheduler.rb
Constant Summary collapse
- EXECUTOR_OPTIONS =
{ min_threads: ENV.fetch('RAILS_MAX_THREADS', 3).to_i, max_threads: ENV.fetch('RAILS_MAX_THREADS', 3).to_i, max_queue: 100, fallback_policy: :caller_runs }.freeze
Class Method Summary collapse
Class Method Details
.queue_adapter ⇒ Object
12 13 14 |
# File 'lib/rails-fast-cache/scheduler.rb', line 12 def self.queue_adapter @queue_adapter ||= ActiveJob::QueueAdapters::AsyncAdapter.new(**EXECUTOR_OPTIONS) end |
.shutdown ⇒ Object
16 17 18 |
# File 'lib/rails-fast-cache/scheduler.rb', line 16 def self.shutdown @queue_adapter&.shutdown(wait: true) end |