def _iterate_websocket(f: websocket.WebSocketFlow) -> TEventGenerator: messages = f.messages f.messages = [] f.reply = controller.DummyReply() yield "websocket_start", f while messages: f.messages.append(messages.pop(0)) yield "websocket_message", f if f.error: yield "websocket_error", f yield "websocket_end", f
def _iterate_websocket(f: websocket.WebSocketFlow) -> TEventGenerator: messages = f.messages f.messages = [] f.reply = controller.DummyReply() yield "websocket_start", f while messages: f.messages.append(messages.pop(0)) yield "websocket_message", f if f.error: yield "websocket_error", f yield "websocket_end", f
def _iterate_websocket(f: websocket.WebSocketFlow) -> TEventGenerator: messages = f.messages f.messages = [] f.reply = controller.DummyReply() yield layers.websocket.WebsocketStartHook(f) while messages: f.messages.append(messages.pop(0)) yield layers.websocket.WebsocketMessageHook(f) if f.error: yield layers.websocket.WebsocketErrorHook(f) else: yield layers.websocket.WebsocketEndHook(f)