Class: Sqskiq::Processor
- Inherits:
-
Object
- Object
- Sqskiq::Processor
- Includes:
- Celluloid, SignalHandler
- Defined in:
- lib/sqskiq/process.rb
Instance Method Summary collapse
-
#initialize(worker_class) ⇒ Processor
constructor
A new instance of Processor.
- #process(message) ⇒ Object
Methods included from SignalHandler
#shutting_down, #subscribe_for_shutdown
Constructor Details
#initialize(worker_class) ⇒ Processor
Returns a new instance of Processor.
10 11 12 13 |
# File 'lib/sqskiq/process.rb', line 10 def initialize(worker_class) @worker_instance = worker_class.new subscribe_for_shutdown end |
Instance Method Details
#process(message) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/sqskiq/process.rb', line 15 def process() return { :success => false, :message => } if @shutting_down result = true begin @worker_instance.perform() rescue Exception => e result = false end return { :success => result, :message => } end |