You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tonic
tonic-build (for an option to pin-box the futures in the codegen builders)
Motivation
Benefits:
Removal of a dependency
Reduction in compilation times for pretty much all tonic-based projects since the async-trait proc macro no longer would need to be invoked by the compiler
async_trait is no longer reexported by tonic as #[tonic::async_trait]
Drawbacks:
Breaking change
Proposal
Instead, the codegen could just spit out a normal trait with fn ... -> impl Future<Output = ...> + Send, and in rare cases where the server traits need object safety (of which there are pretty much none, but just leaving this to contradict the argument of async_trait ever being a good idea to use post-1.75), there could be an opt-in option to use fn ... -> Pin<Box<dyn Future<Output = ...> + Send>> instead.
Alternatives
Keeping async-trait.
The text was updated successfully, but these errors were encountered:
Feature Request
Crates
tonic
tonic-build (for an option to pin-box the futures in the codegen builders)
Motivation
Benefits:
#[tonic::async_trait]
Drawbacks:
Proposal
Instead, the codegen could just spit out a normal trait with
fn ... -> impl Future<Output = ...> + Send
, and in rare cases where the server traits need object safety (of which there are pretty much none, but just leaving this to contradict the argument of async_trait ever being a good idea to use post-1.75), there could be an opt-in option to usefn ... -> Pin<Box<dyn Future<Output = ...> + Send>>
instead.Alternatives
Keeping async-trait.
The text was updated successfully, but these errors were encountered: