class Puma::ThreadPool::Automaton

def initialize(pool, timeout, thread_name, message)

def initialize(pool, timeout, thread_name, message)
  @pool = pool
  @timeout = timeout
  @thread_name = thread_name
  @message = message
  @running = false
end

def start!

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

def stop

def stop
  @running = false
  @thread.wakeup
end