To senkronize websocket\'s events, I wrote the class below. You can easily understand its logic by viewing the code.
class WebSocket: websocket = None def __init