Class: ActiveJob::QueueAdapters::QuberAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/active_job/queue_adapters/quber_adapter.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ QuberAdapter

Returns a new instance of QuberAdapter.



5
6
7
# File 'lib/active_job/queue_adapters/quber_adapter.rb', line 5

def initialize options = {}
  @client ||= Quber::Client.new options
end

Instance Method Details

#enqueue(job, attributes = {}) ⇒ Object



9
10
11
12
# File 'lib/active_job/queue_adapters/quber_adapter.rb', line 9

def enqueue(job, attributes = {})
  task = build_task(job, attributes)
  @client.put task
end

#enqueue_at(job, timestamp) ⇒ Object



14
15
16
# File 'lib/active_job/queue_adapters/quber_adapter.rb', line 14

def enqueue_at(job, timestamp)
  enqueue job, scheduled_at: timestamp
end