Closed sigaloid closed 8 months ago
This would require a lot of overhaul - notably, switching the entire web framework to something like Axum. :thinking:
Sassy HTTP endpoint... :angry:
:grin:
This is not nearly as impressive now that I realize the regular JSON API returns it... the code I wrote was the GQL client :thinking:
This would require a lot of overhaul - notably, switching the entire web framework to something like Axum. 🤔
Why not just use something like https://crates.io/crates/hyper_tungstenite?
The current architecture converts everything to a Request<Body>
from the hyper
crate when building the router. We'd need to handle it a lot sooner in the router path, meaning a lot of changes. If we're going to do that, I would prefer we also move to a better stack - Axum is probably better-equipped to handle a full-stack app, rather than building and manually managing everything from routing, compression, caching, etc.
Did some tests and with tokio-tungstenite, I get incredibly small memory usage (1.2MB!) even with thousands of simultaneous WS connections to a variety of WS streams, getting new comments. :thinking:
Considering this out of scope (for now). I definitely don't think live-streaming and proxying these updates is within the scope of Redlib.
Is your feature request related to a problem? Please describe.
We now use the OAuth endpoints which gives us a plethora of data to play with, including a
wss
url that pushes new commentsDescribe the feature you would like to be implemented
A checkbox to enable "live mode" that will connect to this wss endpoint and proxy through the backend, updating the frontend with new comments.
Describe alternatives you've considered
N/A (polling won't work due to cache)
Additional context / screenshot
Sample of what it looks like:
Interestingly enough, I caught a live comment removal above.