confused about the websocket/chat example model #604
-
Does the web socket loop persist as long as the client is connected, which I can't believe it does do to resource drainage. If not, how do I associate a "user" (e.g. their session id/cookie) with their particular socket?
Do I split the socket on_connect and then shove the write site into a map? I guess it needs to be a weak reference in case the client disappears? I wasn't kidding about the newbie section ;-). |
Beta Was this translation helpful? Give feedback.
Answered by
davidpdrsn
Dec 10, 2021
Replies: 1 comment 6 replies
-
Does the chat example help https://github.com/tokio-rs/axum/blob/main/examples/chat/src/main.rs? |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
yatesco
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does the chat example help https://github.com/tokio-rs/axum/blob/main/examples/chat/src/main.rs?