code: def close(allow_reconnect = false)
        if @connection
          # Disable reconnects if specified
          reconnect = @reconnect
          @reconnect = reconnect && allow_reconnect
  
          # Clean up timers / connections
          @keepalive_timer.cancel if @keepalive_timer
          @keepalive_timer = nil
          @connection.close
  
          # Revert change to reconnect config once the final signal is received
          wait do |&resume|
            on(:session_ended, :once => true) { resume.call }
          end
          @reconnect = reconnect
        end
        
        true
      end
docs: Closes the current connection to Turntable if one was previously opened.
  
   @return [true]