Skip to content

consume_responses

fastagency.ui.mesop.message.consume_responses #

consume_responses(
    responses: Iterable[MesopMessage],
) -> Iterator[None]
Source code in fastagency/ui/mesop/message.py
def consume_responses(responses: Iterable[MesopMessage]) -> Iterator[None]:
    for message in responses:
        state = me.state(State)
        handle_message(state, message)
        yield
        if not isinstance(message.io_message, KeepAlive):
            me.scroll_into_view(key="end_of_messages")
        yield
    yield