feat(transport): Change channel connect to be async (#107)
This makes it so you can check if the initial connection is established. Before this we used reconnect which would lazily attempt to connect. So if you were trying to connect to a non existant Server you wouldn't find out until after you attempted your first RPC. This simplifies everything by allowing you connect before creating the RPC client. BREAKING CHANGE: `Endpoint::channel` was removed in favor of an async `Endpoint::connect`.
This commit is contained in:
@@ -41,7 +41,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
);
|
||||
}
|
||||
|
||||
let channel = endpoint.channel();
|
||||
let channel = endpoint.connect().await?;
|
||||
|
||||
let mut client = client::TestClient::new(channel.clone());
|
||||
let mut unimplemented_client = client::UnimplementedClient::new(channel);
|
||||
|
||||
Reference in New Issue
Block a user