websocket buffer management (python-connector)

Hello. I have few websockets open for trade info. I receive websocket messages and sometimes I run some script based on message. It seems to me that until the scipt is finished, many messages on websocket buffer and then they overload my processing script.

Is there any way how to clear all buffered messages, either by reading/discarding buffered messages, or clear the buffer directly?

Thank you, Jan

This sound more of a programming question, which this Forum might not be the best place for it (we focus on the API usage directly).
Please try to ask in a community of the language you’re asking.