Class: Puma::ThreadPool::Automaton
- Inherits:
-
Object
- Object
- Puma::ThreadPool::Automaton
- Defined in:
- lib/puma/thread_pool.rb
Instance Method Summary collapse
-
#initialize(pool, timeout, thread_name, message) ⇒ Automaton
constructor
A new instance of Automaton.
- #start! ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(pool, timeout, thread_name, message) ⇒ Automaton
311 312 313 314 315 316 317 |
# File 'lib/puma/thread_pool.rb', line 311 def initialize(pool, timeout, thread_name, ) @pool = pool @timeout = timeout @thread_name = thread_name = @running = false end |
Instance Method Details
#start! ⇒ Object
319 320 321 322 323 324 325 326 327 328 329 |
# File 'lib/puma/thread_pool.rb', line 319 def start! @running = true @thread = Thread.new do Puma.set_thread_name @thread_name while @running @pool.public_send() sleep @timeout end end end |
#stop ⇒ Object
331 332 333 334 |
# File 'lib/puma/thread_pool.rb', line 331 def stop @running = false @thread.wakeup end |