Replies: 2 comments 6 replies
-
Also the health example doesn't show how to achieve this. It flips the status of a service every second. But in the real-world we may callback set_serving when the associated service actually started. |
Beta Was this translation helpful? Give feedback.
4 replies
-
I have a similar use case. I'm writing integration tests for my grpc service. I spin up the server ( in a separate tokio::spawn task ) in every test and I want to know once the server is started so that I can proceed with calling my server functions. I'm currently adding a timeout, is there any better alternative to achieve this? tokio::spawn(async { start_server(true).await });
// Can this sleep time be avoided
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
let config = utils::read_config::<ClientConfig>("config/client.toml", Some("BLAZER"));
let mut client = grpc_client::GrpcClient::connect(config.server_url.clone())
.await
.unwrap();
let ping_response = client.ping(PingRequest { user_id: None }).await.unwrap(); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to prompt users when the service is ready to accept requests, but fail to find a method for inserting such a logging point with tonic.
For example, how can I prompt "Server started" when tonic Server finished the internal tasks.
Beta Was this translation helpful? Give feedback.
All reactions