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
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, there could be an opt-in option to use fn ... -> Pin<Box<dyn Future<Output = ...> + Send>> instead.
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]
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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, there could be an opt-in option to usefn ... -> Pin<Box<dyn Future<Output = ...> + Send>>
instead.Benefits:
#[tonic::async_trait]
Drawbacks:
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions