class Puma::ThreadPool::Automaton

Public Class Methods

new(pool, timeout, thread_name, message) click to toggle source
# File lib/puma/thread_pool.rb, line 334
def initialize(pool, timeout, thread_name, message)
  @pool = pool
  @timeout = timeout
  @thread_name = thread_name
  @message = message
  @running = false
end

Public Instance Methods

start!() click to toggle source
# File lib/puma/thread_pool.rb, line 342
def start!
  @running = true

  @thread = Thread.new do
    Puma.set_thread_name @thread_name
    while @running
      @pool.public_send(@message)
      sleep @timeout
    end
  end
end
stop() click to toggle source
# File lib/puma/thread_pool.rb, line 354
def stop
  @running = false
  @thread.wakeup
end