Class: GoodJob::ProbeServer::SimpleHandler
- Inherits:
-
Object
- Object
- GoodJob::ProbeServer::SimpleHandler
- Defined in:
- lib/good_job/probe_server/simple_handler.rb
Constant Summary collapse
- SOCKET_READ_TIMEOUT =
in seconds
5
Instance Method Summary collapse
- #build_future ⇒ Object
-
#initialize(app, options = {}) ⇒ SimpleHandler
constructor
A new instance of SimpleHandler.
- #running? ⇒ Boolean
- #stop ⇒ Object
Constructor Details
#initialize(app, options = {}) ⇒ SimpleHandler
Returns a new instance of SimpleHandler.
8 9 10 11 12 13 14 |
# File 'lib/good_job/probe_server/simple_handler.rb', line 8 def initialize(app, = {}) @app = app @port = [:port] @logger = [:logger] @running = Concurrent::AtomicBoolean.new(false) end |
Instance Method Details
#build_future ⇒ Object
25 26 27 |
# File 'lib/good_job/probe_server/simple_handler.rb', line 25 def build_future Concurrent::Future.new { run } end |
#running? ⇒ Boolean
21 22 23 |
# File 'lib/good_job/probe_server/simple_handler.rb', line 21 def running? @running.true? end |
#stop ⇒ Object
16 17 18 19 |
# File 'lib/good_job/probe_server/simple_handler.rb', line 16 def stop @running.make_false @server&.close end |