If you let Character A just talk and talk and talk, firstly, it's a fairly unnatural situation in real life. We tend to tune out people who just talk without letting us get a word in edgeways. Secondly, what we do in real life we also do as readers. I surely can't be the only reader who didn't realise that the long, long, long witterings from Miss Bates in Emma were actually funny because I just skipped over them. (I learnt differently from seeing a wonderful performance of scenes from Jane Austen by Geraldine McEwan.)
So, how to solve this?
The answer is for Character A to do their talking and for Character B to interject things along the lines of 'Go on'. Make sure that Character B's contributions are infrequent but when they occur are substantial, whether they're verbal or internal thoughts or physical reactions. In other words, you don't want lots of one-liners scattered throughout Character A's speech.
If you have a lot of one-liners, Character B starts to look like a television interviewer doing 'noddies' - those cuts away from the interviewee back to the interviewer nodding understandingly which are filmed separately from the actual interview.
Alternatively, a lot of detective stories are essentially monologues from a series of witnesses interrupted by the detective going, 'And what happened next?'. I randomly picked up Ruth Rendell's An Unkindness of Ravens to see how she solves the issue and the answer is to summarise wherever possible, and use indirect speech. For example:
"She was unable to remember much about 15 April. Certain it was that she had been babysitting her brother that evening and Veronica had come in, but she couldn't remember times. Veronica and she were often in each other's homes, she said."
The problem is compounded if what Character A is saying is unlikely to be interrupted by Character B - Character A is delivering a lecture, for example. Character B is going to have to do a lot of shifting in their seat or observing things on the stage. Better to summarise the lecture from Character B's point of view. This example is from A Single to Rome. Guy is giving a lecture on Roman concrete, and Natalie is in the audience:
"He talked about the earlier assumptions that the Romans had 'got lucky' with natural volcanic deporsis, and how new studies in geopolymeric materials (a phrase that would never have tripped of Natalie's tongue as easily as it did off Guy's) showed that the most recent analyses of carbunculus (another word that had not troubled Natalie before) demonstrated that the Romans were using sophisticated artificial concretes rather than natural deposits."
When the information is coming from a letter or newspaper article it is usually written in italics to indicate to the reader it's a letter or article. Break it up in one or two places, showing the reader that a) Character B is still around and b) how Character B is reacting to the information. In A Single to Rome Natalie writes a letter to her ex-boyfriend that goes on for two pages. It's broken in 3 places by a section of Natalie's emotional reaction (not in italics) that each last for 3-4 lines.
So, several different ways of dealing with the problem - and I expect there are more; any ideas?