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

Instance Method Summary collapse

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

Parameters:

  • params (Hash)

    income parameters



38
39
40
# File 'lib/frigate/operation/worker.rb', line 38

def perform(params)
	run(deserialize_params(params))
end