Class: Kindly::Requester

Inherits:
Object
  • Object
show all
Defined in:
lib/kindly/requester.rb

Instance Method Summary collapse

Constructor Details

#initializeRequester

Returns a new instance of Requester.



6
7
8
9
# File 'lib/kindly/requester.rb', line 6

def initialize
  @queue = Queue.new
  @db = DB.new
end

Instance Method Details

#request(job_name, input = {}) ⇒ Object



11
12
13
14
# File 'lib/kindly/requester.rb', line 11

def request(job_name, input = {})
  job = @db.insert_job(job_name, input)
  @queue.add(job_name, job['JobId'])
end