Class: RailsAsyncMigrations::Workers
- Inherits:
-
Object
- Object
- RailsAsyncMigrations::Workers
- Defined in:
- lib/rails_async_migrations/workers.rb,
lib/rails_async_migrations/workers/sidekiq/check_queue_worker.rb,
lib/rails_async_migrations/workers/sidekiq/fire_migration_worker.rb
Defined Under Namespace
Modules: Sidekiq
Constant Summary collapse
- ALLOWED =
[:check_queue, :fire_migration].freeze
Instance Attribute Summary collapse
-
#called_worker ⇒ Object
readonly
Returns the value of attribute called_worker.
Instance Method Summary collapse
-
#initialize(called_worker) ⇒ Workers
constructor
A new instance of Workers.
- #perform(args = []) ⇒ Object
Constructor Details
#initialize(called_worker) ⇒ Workers
Returns a new instance of Workers.
7 8 9 10 |
# File 'lib/rails_async_migrations/workers.rb', line 7 def initialize(called_worker) @called_worker = called_worker # :check_queue, :fire_migration ensure_worker_presence end |
Instance Attribute Details
#called_worker ⇒ Object (readonly)
Returns the value of attribute called_worker.
5 6 7 |
# File 'lib/rails_async_migrations/workers.rb', line 5 def called_worker @called_worker end |
Instance Method Details
#perform(args = []) ⇒ Object
12 13 14 15 |
# File 'lib/rails_async_migrations/workers.rb', line 12 def perform(args = []) return unless ALLOWED.include? called_worker self.send called_worker, *args end |