def stop(&callback)
      send_command(:name => :close_connection)
      @stopped_callback = callback
      Log.info("[cook] Disconnecting from agent (#{@pending} response#{@pending > 1 ? 's' : ''} pending)")
      @stop_timeout = EM::Timer.new(STOP_TIMEOUT) do
        Log.warning("[cook] Time out waiting for responses from agent, forcing disconnection")
        @stop_timeout = nil
        on_stopped
      end
      true
    end
def stop(&callback)
      send_command(:name => :close_connection)
      @stopped_callback = callback
      Log.info("[cook] Disconnecting from agent (#{@pending} response#{@pending > 1 ? 's' : ''} pending)")
      @stop_timeout = EM::Timer.new(STOP_TIMEOUT) do
        Log.warning("[cook] Time out waiting for responses from agent, forcing disconnection")
        @stop_timeout = nil
        on_stopped
      end
      true
    end
Stop command client, wait for all pending commands to finish prior
 to calling given callback

 === Return
 true:: Always return true

 === Block
 called once all pending commands have completed