Module: Frigate::Operation::Worker
- Defined in:
- lib/frigate/operation/worker.rb
Overview
A module that allows operation to perform as a background job, using Sidekiq as BJ for now
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
-
.included(base) ⇒ Object
Included hook.
Instance Method Summary collapse
-
#perform(params) ⇒ Object
Method that runs operation mechanism.
Class Method Details
.included(base) ⇒ Object
Included hook
6 7 8 9 |
# File 'lib/frigate/operation/worker.rb', line 6 def self.included(base) base.send(:include, Sidekiq::Worker) # TODO: this will work with any background gem. base.extend(ClassMethods) end |
Instance Method Details
#perform(params) ⇒ Object
Method that runs operation mechanism. It’s here because of Sidekiq::Worker needs it
38 39 40 |
# File 'lib/frigate/operation/worker.rb', line 38 def perform(params) run(deserialize_params(params)) end |