A talkative friend will be avoided by many of us for their non-stop chanting. They cane be frustrating too when we don't have the chance to speak and when our mood is badly down. But if we think smartly, we can deal with such talkative friends and make them think.
First thing, if you are not interested in the conversation, give a no-interest look without hesitation. As it would make your friend realize that you are nowhere interested. This could make your friend little let down and will slowly stop. But if you want to continue talking with your friend, make it interesting. Communication is all about exchanging information, the effective information we share is good for us too.
If you know more about a topic that you are having conversation with your friend, instead of him/her, you take the initiative and talk more about it. Then later put an end to it indefinitely and tell your friend that you have to visit a place. Also promise them to continue the conversation later.
Well then try once.