Class: Utils::ProbeServer
Instance Method Summary collapse
- #enqueue(job) ⇒ Object (also: #run)
-
#initialize ⇒ ProbeServer
constructor
A new instance of ProbeServer.
- #shutdown ⇒ Object
Constructor Details
#initialize ⇒ ProbeServer
Returns a new instance of ProbeServer.
11 12 13 14 |
# File 'lib/utils/probe_server.rb', line 11 def initialize @jobs = Queue.new Thread.new { work_loop } end |
Instance Method Details
#enqueue(job) ⇒ Object Also known as: run
16 17 18 19 |
# File 'lib/utils/probe_server.rb', line 16 def enqueue(job) "Job #{job.inspect} enqueued.".black.on_yellow @jobs.push job end |
#shutdown ⇒ Object
22 23 24 25 |
# File 'lib/utils/probe_server.rb', line 22 def shutdown "Server was shutdown down – HARD!".white.on_red.blink exit! 23 end |