Class: AtomicSidekiq::InFlightQueue
- Inherits:
-
Object
- Object
- AtomicSidekiq::InFlightQueue
- Defined in:
- lib/atomic_sidekiq/in_flight_queue.rb
Instance Method Summary collapse
- #delete_job(jid) ⇒ Object
-
#initialize ⇒ InFlightQueue
constructor
A new instance of InFlightQueue.
- #list ⇒ Object
Constructor Details
#initialize ⇒ InFlightQueue
3 4 5 |
# File 'lib/atomic_sidekiq/in_flight_queue.rb', line 3 def initialize @keymaker = InFlightKeymaker.new(AtomicFetch::IN_FLIGHT_KEY_PREFIX) end |
Instance Method Details
#delete_job(jid) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/atomic_sidekiq/in_flight_queue.rb', line 12 def delete_job(jid) job_matcher = keymaker.job_matcher(jid) job_keys = retrieve_keys(job_matcher) return 0 if job_keys.empty? Sidekiq.redis { |conn| conn.del(*job_keys) } end |
#list ⇒ Object
7 8 9 10 |
# File 'lib/atomic_sidekiq/in_flight_queue.rb', line 7 def list keys = list_keys retrieve_jobs(keys) end |