Allow thin clients to be passed across thread boundaries (#3887)

* Remove ThinClient wrapper

* Allow RpcClient (and ThinClient) to be passed across thread boundaries

* Pass clients, not constructors

* Fix bad rebase
This commit is contained in:
Greg Fitzgerald
2019-04-19 08:54:21 -06:00
committed by GitHub
parent baac21209e
commit 809b051f10
3 changed files with 50 additions and 62 deletions

View File

@ -19,7 +19,7 @@ use std::thread::sleep;
use std::time::{Duration, Instant};
pub struct RpcClient {
client: Box<GenericRpcClientRequest>,
client: Box<GenericRpcClientRequest + Send + Sync>,
}
impl RpcClient {
@ -743,4 +743,9 @@ mod tests {
);
}
#[test]
fn test_rpc_client_thread() {
let rpc_client = RpcClient::new_mock("succeeds".to_string());
thread::spawn(move || rpc_client);
}
}