def on_close(self): """ Called when the WebSocket is closed, delete the link between this object and its WebSocket. """ self.websocket.handlers.remove(self)