コード例 #1
0
ファイル: eventsequence.py プロジェクト: dingyuanxia/hogwarts
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
コード例 #2
0
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
コード例 #3
0
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)