Module: HanselCore::JobQueue
- Included in:
- Hansel
- Defined in:
- lib/hansel/job_queue/job_queue.rb
Instance Method Summary collapse
Instance Method Details
#jobs ⇒ Object
3 4 5 |
# File 'lib/hansel/job_queue/job_queue.rb', line 3 def jobs @jobs end |
#load_job_queue ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/hansel/job_queue/job_queue.rb', line 15 def load_job_queue (YAML.load_file File.join(config_path, 'jobs.yml')).map do |job| job.merge!({:port => 80}) unless job[:port] self.push_job(OpenStruct.new job) end self end |
#pop_job(job) ⇒ Object
11 12 13 |
# File 'lib/hansel/job_queue/job_queue.rb', line 11 def pop_job job @jobs.pop end |
#push_job(job) ⇒ Object
7 8 9 |
# File 'lib/hansel/job_queue/job_queue.rb', line 7 def push_job job @jobs.push job end |