Replies: 1 comment 1 reply
-
I would suggest looking at the hyper example and only spawning a single hyper server. Hyper's builders expose a |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context
I have an application that exposes different types of APIs (REST, gRPC, ...). Each exposed API runs in a receiver task. A mpsc receiver is provided to each receiver to receive commands from an application controller. For example the app controller can use the mpsc channels to send a stop command to every receivers to implement graceful shutdown.
I'd like to combine the mpsc receiver with a tonic server inside a tokio select loop in order to interleave commands and grpc calls (see pseudo code below). I didn't find an equivalent of my pseudo method
accept
without recreating entirely the tonic server in every iteration.Pseudo code (not working)
Questions
Beta Was this translation helpful? Give feedback.
All reactions