mirror of
https://github.com/OMGeeky/tarpc.git
synced 2026-01-01 09:03:48 +01:00
Fix examples
This commit is contained in:
@@ -47,7 +47,7 @@ impl HelloService for HelloServer {
|
||||
|
||||
fn main() {
|
||||
let server_handle = HelloServer.spawn("0.0.0.0:0").unwrap();
|
||||
let client = hello_service::Client::new(server_handle.local_addr()).unwrap();
|
||||
let client = hello_service::Client::new(server_handle.dialer()).unwrap();
|
||||
assert_eq!("Hello, Mom!", client.hello("Mom".into()).unwrap());
|
||||
drop(client);
|
||||
server_handle.shutdown();
|
||||
|
||||
@@ -41,8 +41,9 @@ mod benchmark {
|
||||
Arc::new(Mutex::new(handle))
|
||||
};
|
||||
static ref CLIENT: Arc<Mutex<AsyncClient>> = {
|
||||
let addr = HANDLE.lock().unwrap().local_addr().clone();
|
||||
let client = AsyncClient::new(addr).unwrap();
|
||||
let lock = HANDLE.lock().unwrap();
|
||||
let dialer = lock.dialer();
|
||||
let client = AsyncClient::new(dialer).unwrap();
|
||||
Arc::new(Mutex::new(client))
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user