remove comments for future ffi push + lower default pool size from 4 to 2

This commit is contained in:
mfahampshire
2024-12-16 18:51:05 +01:00
parent d59f05f9d4
commit 7fa1cdba93
2 changed files with 1 additions and 24 deletions
-23
View File
@@ -22,15 +22,6 @@ lazy_static! {
static ref RUNTIME: Runtime = Runtime::new().unwrap();
}
// TODO create get_client() to use in fns and remove code repetition
fn get_client_as_ref() -> bool {
NYM_CLIENT.lock().unwrap().as_ref().is_some()
}
fn get_client_guard() -> bool {
todo!()
}
pub fn init_ephemeral_internal() -> Result<(), Error> {
if NYM_CLIENT.lock().unwrap().as_ref().is_some() {
bail!("client already exists");
@@ -46,20 +37,6 @@ pub fn init_ephemeral_internal() -> Result<(), Error> {
Ok::<(), Error>(())
})?;
}
// if get_client_as_ref() {
// RUNTIME.block_on(async move {
// let init_client = MixnetClient::connect_new().await?;
// let mut client = NYM_CLIENT.try_lock();
// if let Ok(ref mut client) = client {
// **client = Some(init_client);
// } else {
// return Err(anyhow!("couldnt lock ephemeral NYM_CLIENT"));
// }
// Ok::<(), Error>(())
// })?;
// } else {
// bail!("client already exists: no need to reinitialise");
// }
Ok(())
}
@@ -20,7 +20,7 @@ use utils::{MessageBuffer, Payload, ProxiedMessage};
const DEFAULT_CLOSE_TIMEOUT: u64 = 60; // seconds
const DEFAULT_LISTEN_HOST: &str = "127.0.0.1";
const DEFAULT_LISTEN_PORT: &str = "8080";
const DEFAULT_CLIENT_POOL_SIZE: usize = 4;
const DEFAULT_CLIENT_POOL_SIZE: usize = 2;
pub struct NymProxyClient {
server_address: Recipient,