Following closely on the heels of disrespect is prejudice. Prejudice is fairly common and hardly always a reason to end a discussion, however there are particular scenarios in which the best course of action to undertake is to simply end a discourse with someone who is prejudiced against you.
Almost everyone knows what a kangaroo court is. In case you don't, it is a court where your innocence or guilt has been determined before you appeared to defend yourself. The court exists purely to give the impression of fairness. In the same way some prejudiced people will listen to other positions with the express decision to dismiss those positions out of hand as soon as they have heard them. I think sales people understand the principle best when they approach people or do a cold call and realise that the person they are communicating with is very unlikely to buy the product. So unlikely, that it makes more sense to move to someone else who might be more open and in need of the product.
In the same way, the amount of discussions you can have are finite, and by spending time with someone who you can see is very unlikely to take your positions seriously you are losing time that could have been used on better discussions.
There are many reasons to be prejudiced. Maybe you are gay, hold different religious views, are young, perhaps you are less experienced. None of these reasons should dismiss you from a discussion. Who you are has nothing to do with the points you put forward. If you can see that someone is not taking you seriously because of who you are instead of paying attention to the content of what you are saying, the same principle applies as with previous reasons for ending discussions.
Identifying prejudice is usually easy, and you should be mindful of identifying it in yourself. As before, if you find yourself to hold a strong prejudice against someone it might be a good idea not to engage with that person, or to end a discussion if you can't set your own prejudices aside even for a moment. When someone is prejudiced they will make generalisations and use words like all and always to refer to groups people belong to and polarising words like evil, degenerate, subhuman. A statement like "All Christians are subhuman scum" should be a clear problem if you are a Christian. But don't simply end discussions at the first sign of prejudice. We should always try and give people a chance, because if we are wrong we would want them to give us a chance right?
First have a discussion about the problem. Point out the prejudice and ask the other person to put it aside for the sake of the discussion. If someone cannot respond and keeps saying things like "you're too young to understand" or "you don't have enough experience" or "all gays are evil child molesters" there is nothing you can do. I end these types of discussions by pointing out why I feel that I do not have a fair chance to be heard and then ignore subsequent commentary from that person or if it is a discussion in person I change the topic. You cannot convince someone of something if they are already convinced that anything you say is invalid without giving it a thought.