Class: ActiveJob::QueueAdapters::K8sAdapter
- Inherits:
-
Object
- Object
- ActiveJob::QueueAdapters::K8sAdapter
- Defined in:
- lib/active_job/queue_adapters/k8s_adapter.rb
Instance Attribute Summary collapse
-
#scheduler ⇒ Object
readonly
Returns the value of attribute scheduler.
Instance Method Summary collapse
- #enqueue(job) ⇒ Object
- #enqueue_at(job, scheduled_at) ⇒ Object
-
#initialize(**executor_options) ⇒ K8sAdapter
constructor
A new instance of K8sAdapter.
Constructor Details
#initialize(**executor_options) ⇒ K8sAdapter
Returns a new instance of K8sAdapter.
11 12 13 |
# File 'lib/active_job/queue_adapters/k8s_adapter.rb', line 11 def initialize(**) @scheduler = ActiveJobK8s::Scheduler.new(**) end |
Instance Attribute Details
#scheduler ⇒ Object (readonly)
Returns the value of attribute scheduler.
9 10 11 |
# File 'lib/active_job/queue_adapters/k8s_adapter.rb', line 9 def scheduler @scheduler end |
Instance Method Details
#enqueue(job) ⇒ Object
15 16 17 |
# File 'lib/active_job/queue_adapters/k8s_adapter.rb', line 15 def enqueue(job) scheduler.create_job(job) end |
#enqueue_at(job, scheduled_at) ⇒ Object
19 20 21 |
# File 'lib/active_job/queue_adapters/k8s_adapter.rb', line 19 def enqueue_at(job,scheduled_at) scheduler.create_job(job,scheduled_at:scheduled_at) end |