deps.rs
deps.rs copied to clipboard
refactor: migrate web server to Actix Web
full-fat Actix Web conversion including (somewhat necessary) improvements to error handling
pros:
- –91 LoC (smallest final result)
- clearer error handling
- we can use automatic HTTP/2 connections from the reverse proxy if we want to
- access to large library of first- and third-party middleware
cons:
- biggest diff
tokei:
Language Files Lines Code Comments Blanks
===============================================================================
Rust 31 3861 3324 21 516
|- Markdown 5 47 0 42 5
(Total) 3908 3324 63 521
The pull requests are in need of a rebase after the migration to tracing, but other than that I hold no objections to moving forward with Actix Web once that is resolved.
I haven't used actix-web in a while and just seeing the much better out of the box error handling is refreshing.
we can use automatic HTTP/2 connections from the reverse proxy if we want to
Is that worth it given https://github.com/hyperium/h2/issues/531? Or does actix-web have a solution for it?
Actix Web is already thread-per-core so each worker would have its own "instance" of h2, meaning the mutexes are uncontended. IIRC things are fast in such cases.
This is in need of a rebase again. Can you handle this?
ahh yes
- #[get("/crate/:name")]
+ #[get("/crate/{name}")]