Run cargo fmt.

This commit is contained in:
Elizabeth Murray
2025-06-20 08:28:40 -07:00
parent cac4ee8ea3
commit 261a9ae093
@@ -1,23 +1,22 @@
use async_trait::async_trait;
use priority_queue::PriorityQueue;
use std::{
collections::HashMap,
sync::Arc,
time::{Duration, Instant},
};
use priority_queue::PriorityQueue;
use tokio::{
sync::{Mutex, OwnedSemaphorePermit, Semaphore},
};
use tokio::sync::{Mutex, OwnedSemaphorePermit, Semaphore};
use uuid;
use async_trait::async_trait;
#[async_trait]
pub trait PooledClientFactory<T>: Send + Sync + 'static {
/// Create a new pooled item.
async fn create(&self, connect_timeout: Duration) -> Result<Result<T, tonic::Status>, tokio::time::error::Elapsed>;
async fn create(
&self,
connect_timeout: Duration,
) -> Result<Result<T, tonic::Status>, tokio::time::error::Elapsed>;
}
/// A pooled gRPC client with capacity tracking and error handling.
pub struct ClientCache<T> {
inner: Mutex<Inner<T>>,
@@ -57,7 +56,6 @@ struct CacheEntry<T> {
last_used: Instant,
}
/// A client borrowed from the pool.
pub struct PooledClient<T> {
pub client: T,
@@ -103,6 +101,3 @@ impl<T: Clone + Send + 'static> PooledClient<T> {
return self.client.clone();
}
}