mirror of
https://github.com/OMGeeky/tarpc.git
synced 2026-01-03 01:52:30 +01:00
Make Client Send again (and Clone too!).
The basic strategy is to start a reactor on a dedicated thread running a request stream. Requests are spawned onto the reactor, allowing multiple requests to be processed concurrently. For example, if you clone the client to make requests from multiple threads, they won't have to wait for each others' requests to complete before theirs start being sent out. Also, client rpcs only take &self now, which was also required for clients to be usable in a service. Also added a test to prevent regressions.
This commit is contained in:
@@ -59,7 +59,7 @@ fn main() {
|
||||
tx.send(handle.addr()).unwrap();
|
||||
handle.run();
|
||||
});
|
||||
let mut client = SyncClient::connect(rx.recv().unwrap(), client::Options::default()).unwrap();
|
||||
let client = SyncClient::connect(rx.recv().unwrap(), client::Options::default()).unwrap();
|
||||
println!("{}", client.hello("Mom".to_string()).unwrap());
|
||||
println!("{}", client.hello("".to_string()).unwrap_err());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user