Class: Quebert::Backend::Sync

Inherits:
Object
  • Object
show all
Defined in:
lib/quebert/backend/sync.rb

Overview

Run the job syncronously. This is typically used in a testing environment or could be used as a fallback if other backends fail to initialize

Instance Method Summary collapse

Instance Method Details

#put(job, *args) ⇒ Object



6
7
8
# File 'lib/quebert/backend/sync.rb', line 6

def put(job, *args)
  Controller::Base.new(Job.from_json(job.to_json)).perform
end

#reserve(*args, &block) ⇒ Object



10
11
12
13
# File 'lib/quebert/backend/sync.rb', line 10

def reserve(*args, &block)
  # reserve doesn't do anything in sync mode
  @null_controller ||= Controller::NullController.new
end