Class: ActiveJob::QueueAdapters::CloudTasksAdapter

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

Instance Method Summary collapse

Constructor Details

#initialize(project_id: nil, location_id: nil, http_target: nil, timeout: nil) ⇒ CloudTasksAdapter

Returns a new instance of CloudTasksAdapter.



8
9
10
11
12
13
# File 'lib/active_job/queue_adapters/cloud_tasks_adapter.rb', line 8

def initialize(project_id: nil, location_id: nil, http_target: nil, timeout: nil)
  @project_id  = project_id
  @location_id = location_id
  @timeout     = timeout
  @http_target = http_target
end

Instance Method Details

#enqueue(job) ⇒ Object



15
16
17
# File 'lib/active_job/queue_adapters/cloud_tasks_adapter.rb', line 15

def enqueue(job)
  create_cloud_task(job)
end

#enqueue_at(job, timestamp) ⇒ Object



19
20
21
# File 'lib/active_job/queue_adapters/cloud_tasks_adapter.rb', line 19

def enqueue_at(job, timestamp)
  create_cloud_task(job, timestamp)
end