def destroy(*args)
      options = args.extract_options!

      # Get connection or search for connection with cid
      if options[:cid]
        conn = connections[options[:cid]]
        cid = options[:cid]
      elsif options[:id]
        conn, cid = find_connection(options[:id])
      end
      return false unless conn && cid

      # Kill connection, remove from keys, and delete from list
      begin
        thr = Thread.new do
          storage.delete(teams_key, conn.id) rescue nil
          storage.delete(tokens_key, conn.id) rescue nil if options[:remove_token]
        end
        thr.join
        connections.delete(cid)
      rescue
        nil
      end
    rescue => err
      on_error(err)
    end
def destroy(*args)
      options = args.extract_options!

      # Get connection or search for connection with cid
      if options[:cid]
        conn = connections[options[:cid]]
        cid = options[:cid]
      elsif options[:id]
        conn, cid = find_connection(options[:id])
      end
      return false unless conn && cid

      # Kill connection, remove from keys, and delete from list
      begin
        thr = Thread.new do
          storage.delete(teams_key, conn.id) rescue nil
          storage.delete(tokens_key, conn.id) rescue nil if options[:remove_token]
        end
        thr.join
        connections.delete(cid)
      rescue
        nil
      end
    rescue => err
      on_error(err)
    end
Disconnect from a RTM connection