dag: extract TestDag::set_remote from client

Summary: It will be used by the next change.

Reviewed By: andll

Differential Revision: D29363802

fbshipit-source-id: 842735ac05ea5fea4ea0c3625a68d06d27bc37d5
This commit is contained in:
Jun Wu 2021-06-24 15:11:45 -07:00 committed by Facebook GitHub Bot
parent c908ead7fa
commit 27f864cc5b

View File

@ -157,11 +157,16 @@ impl TestDag {
/// Use this DAG as the "server", return the "client" Dag that has lazy Vertexes.
pub async fn client(&self) -> TestDag {
let mut client = TestDag::new();
let remote = self.remote_protocol(client.output.clone());
client.dag.set_remote_protocol(remote);
client.set_remote(&self);
client
}
/// Update remote protocol to use the (updated) server graph.
pub fn set_remote(&mut self, server_dag: &Self) {
let remote = server_dag.remote_protocol(self.output.clone());
self.dag.set_remote_protocol(remote);
}
/// Similar to `client`, but also clone the Dag from the server.
pub async fn client_cloned_data(&self) -> TestDag {
let mut client = self.client().await;