feat(transport): port router to axum#830
Conversation
LucioFranco
left a comment
There was a problem hiding this comment.
Big big big fan of this! One question really...and I think we should update the readme hyping this up a bit :)
LucioFranco
left a comment
There was a problem hiding this comment.
🔥 I think this is one of the most exciting PRs we've had in a while, super hyped for this!
|
We also probably want to consider doing a blog post for this, since it shows how the ecosystem can glue together and that tonic and axum are not really competitors in a sense. |
Thats a great idea! I'll do that when we ship the next major version of tonic 😊 |
| pub fn add_service<S>(&mut self, svc: S) -> Router<L> | ||
| where | ||
| S: Service<Request<Body>, Response = Response<BoxBody>> | ||
| S: Service<Request<Body>, Response = Response<BoxBody>, Error = Infallible> |
There was a problem hiding this comment.
Should we do this in this PR or another but we should maybe makeRequest<impl Body> instead of hard coding it to hyper?
There was a problem hiding this comment.
Good idea. I think we should explore it separately though.
This ports tonic's previous routing setup to axum. This is mostly just a proposal. I think it lead to some decent wins but might not make that much difference in practice. Its a breaking change so we have to wait until 0.7 if we decide to go this way.
Neversince axum requires services to useInfallible. Can easily convert between them but if we're making breaking changes we might as well removeNever.add_servicenow requires service's to be infallible. This shouldn't cause any breakage since generated services were already infallible, the trait bounds just didn't require it.