proper failover

This commit is contained in:
Lev Kokotov
2022-02-05 13:15:53 -08:00
parent a6574acbc3
commit 8479c74354
5 changed files with 81 additions and 65 deletions

View File

@@ -8,6 +8,7 @@ use tokio::io::{AsyncReadExt, BufReader};
use tokio::net::tcp::{OwnedReadHalf, OwnedWriteHalf};
use tokio::net::TcpStream;
use crate::config::Address;
use crate::errors::Error;
use crate::messages::*;
use crate::ClientServerMap;
@@ -350,4 +351,11 @@ impl Server {
.query(&format!("SET application_name = '{}'", name))
.await?)
}
pub fn address(&self) -> Address {
Address {
host: self.host.to_string(),
port: self.port.to_string(),
}
}
}