Update README.md
All checks were successful
Build library & run tests / build (unix) (push) Successful in 28s
Build library & run tests / build (tcp) (push) Successful in 30s

This commit is contained in:
2024-06-24 16:58:14 +02:00
parent bf183a0598
commit bfd4c1346f
3 changed files with 59 additions and 27 deletions

View File

@@ -40,7 +40,7 @@ enum TestProtocol {
#[derive(Clone)]
struct TrivialServer;
impl TestProtocolServerTrait for TrivialServer {
impl TestProtocolServerHandler for TrivialServer {
async fn addition(&mut self, a: i32, b: i32) -> i32 {
a + b
}
@@ -74,7 +74,7 @@ async fn e2e() {
#[cfg(feature = "tcp")]
let address = format!("127.0.0.1:{}", 10000 + rand::random::<u64>() % 1000);
let server_task = tokio::spawn(TestProtocolServer::bind(TrivialServer, address.clone()));
// Wait for the server to start
// Wait for the server to start, the developer is responsible for this in production
tokio::time::sleep(std::time::Duration::from_millis(10)).await;
let client = TestProtocolClient::connect(address).await.unwrap();
assert_eq!(client.addition(2, 5).await.unwrap(), 7);