Class: Vop::AsyncExecutorWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
lib/vop/util/worker.rb

Instance Method Summary collapse

Instance Method Details

#perform(request_json) ⇒ Object


9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/vop/util/worker.rb', line 9

def perform(request_json)
  begin
    op = ::Vop.boot
    request = ::Vop::Request::from_json(op, request_json)
    puts "performing #{request.pretty_inspect}"
    response = op.execute_request(request)
    puts "response : #{response.status}"
    puts response.result
  rescue => e
    puts "[ERROR] #{e.message}\n#{e.backtrace.join("\n")}"
  end
end