How do you get the last message received from server even if there are unread messages in queue?
Also, how could I ignore (delete) the rest of the unread messages?
CODE example:
while True:
msg = await ws_server.recv()
await do_something_with_latest_message(msg)
I Nead something like:
while True:
msg = await ws_server.recv_last_msg() # On next loop I should "await" until a newer msg comes, not te receive the previous msg in LIFO order
await do_something_with_latest_message(msg)