Class: PassiveQueue::Adapter
- Inherits:
-
Object
- Object
- PassiveQueue::Adapter
- Defined in:
- lib/passive_queue/adapter.rb
Overview
ActiveJob queue adapter that accepts jobs but never processes them. Implements the ActiveJob adapter interface with zen-like non-execution.
Instance Method Summary collapse
-
#enqueue(job) ⇒ void
Enqueues a job for immediate non-execution.
-
#enqueue_all(jobs) ⇒ Array<void>
Enqueues multiple jobs for batch non-execution.
-
#enqueue_at(job, timestamp) ⇒ void
Enqueues a job for delayed non-execution at a specific time.
-
#initialize ⇒ Adapter
constructor
Initializes a new Adapter instance with the zen of doing nothing.
-
#stopping? ⇒ Boolean
Returns whether the adapter is stopping (always true for zen purposes).
Constructor Details
#initialize ⇒ Adapter
Initializes a new Adapter instance with the zen of doing nothing
6 7 8 |
# File 'lib/passive_queue/adapter.rb', line 6 def initialize # Initialize with the zen of doing nothing end |
Instance Method Details
#enqueue(job) ⇒ void
This method returns an undefined value.
Enqueues a job for immediate non-execution
14 15 16 |
# File 'lib/passive_queue/adapter.rb', line 14 def enqueue(job) log_job_acceptance(job) end |
#enqueue_all(jobs) ⇒ Array<void>
Enqueues multiple jobs for batch non-execution
31 32 33 |
# File 'lib/passive_queue/adapter.rb', line 31 def enqueue_all(jobs) jobs.map { |job| enqueue(job) } end |
#enqueue_at(job, timestamp) ⇒ void
This method returns an undefined value.
Enqueues a job for delayed non-execution at a specific time
23 24 25 |
# File 'lib/passive_queue/adapter.rb', line 23 def enqueue_at(job, ) log_job_scheduling(job, ) end |
#stopping? ⇒ Boolean
Returns whether the adapter is stopping (always true for zen purposes)
38 39 40 |
# File 'lib/passive_queue/adapter.rb', line 38 def stopping? true end |