tonic icon indicating copy to clipboard operation
tonic copied to clipboard

Single threaded server example with `async_trait(?Send)`

Open cavemanloverboy opened this issue 11 months ago • 2 comments

There are zero examples of anything using #[tonic::async_trait(?Send)]. Can we fix this?

I'm having trouble trying to build a single-threaded server using tokio's current_thread runtime because the autogenerated traits for the service have Send + Sync

cavemanloverboy avatar Feb 01 '25 02:02 cavemanloverboy

It seems that the single-threaded server is not implemented. https://github.com/hyperium/tonic/blob/78be69e92f297929d8f711d1927e4bdda8c324da/tonic-build/src/server.rs#L224

harry0349 avatar Feb 10 '25 07:02 harry0349

I also am interested. Using tonic is so horrible when you want to use a different async framework like monoio that doesn't require Send.

Eclextic avatar Mar 04 '25 15:03 Eclextic