Class: Rocketman::JobQueue

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/rocketman/job_queue.rb

Constant Summary collapse

QUEUE_KEY =
"rocketman".freeze

Instance Method Summary collapse

Constructor Details

#initializeJobQueue

Returns a new instance of JobQueue.



12
13
14
15
16
17
# File 'lib/rocketman/job_queue.rb', line 12

def initialize
  @storage = Rocketman.configuration.storage
  @jobs = get_job_queue

  at_exit { persist_events } if @storage.class.to_s == "Redis"
end

Instance Method Details

#schedule(job) ⇒ Object



19
20
21
# File 'lib/rocketman/job_queue.rb', line 19

def schedule(job)
  @jobs << job
end