[Python] Consuming REST messages in the "right" order

Discussão em 'Python' iniciado por Stack, Agosto 7, 2025.

  1. Stack

    Stack Membro Participativo

    I'm building a chat application on top of a REST API, and I want to ensure that messages are displayed to the receiver in the same order as they were produced by the sender. Taking inspiration from the TCP protocol, I thought of adding sequence numbers to the messages, so that if there is a gap between the last message sent and received the app knows to wait for the intervening message (or request a re-transmission after a timeout, etc). My questions are:

    1. Is there a more "natural" way to solve this problem?
    2. Are there any Python REST packages (or extensions thereof) that already implement this sort of session management?

    Continue reading...

Compartilhe esta Página