Class: ActiveJob::QueueAdapters::KubeQueueAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/active_job/adapters/kube_queue_adapter.rb

Overview

KubeQueue adapter for ActiveJob ==

To use KubeQueue set the queue_adapter config to :kube_queue.

Rails.application.config.active_job.queue_adapter = :kube_queue

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.enqueue(job) ⇒ Object

Interface for ActiveJob 4.2



12
13
14
# File 'lib/active_job/adapters/kube_queue_adapter.rb', line 12

def enqueue(job)
  KubeQueue.executor.enqueue(job)
end

.enqueue_at(job, timestamp) ⇒ Object



16
17
18
19
# File 'lib/active_job/adapters/kube_queue_adapter.rb', line 16

def enqueue_at(job, timestamp)
  job.scheduled_at = timestamp
  KubeQueue.executor.enqueue(job)
end

Instance Method Details

#enqueue(job) ⇒ Object

Interface for ActiveJob 5.0



23
24
25
# File 'lib/active_job/adapters/kube_queue_adapter.rb', line 23

def enqueue(job)
  KubeQueueAdapter.enqueue(job)
end

#enqueue_at(job, timestamp) ⇒ Object



27
28
29
30
# File 'lib/active_job/adapters/kube_queue_adapter.rb', line 27

def enqueue_at(job, timestamp)
  job.scheduled_at = timestamp
  KubeQueueAdapter.enqueue(job)
end