diff options
author | Yuchen Wu <[email protected]> | 2024-03-29 15:42:20 -0700 |
---|---|---|
committer | Andrew Hauck <[email protected]> | 2024-04-05 11:46:20 -0700 |
commit | dfcd3d1d9f493b830e97757ba8d43c07ee81c030 (patch) | |
tree | 0cfa357cd4257b0ea2b7c2d116c937426190b1cd /pingora-pool | |
parent | 3c5d99c3f49a8d40a0fc16895b148dea9ea18e8d (diff) | |
download | pingora-dfcd3d1d9f493b830e97757ba8d43c07ee81c030.tar.gz pingora-dfcd3d1d9f493b830e97757ba8d43c07ee81c030.zip |
Fix typos and grammar issues in docs
And other things.
Co-authored-by: DimanNe <[email protected]>
Co-authored-by: Xiaobo Liu <[email protected]>
Co-authored-by: houseme <[email protected]>
Co-authored-by: lilo <[email protected]>
Co-authored-by: Yang He <[email protected]>
Diffstat (limited to 'pingora-pool')
-rw-r--r-- | pingora-pool/src/connection.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pingora-pool/src/connection.rs b/pingora-pool/src/connection.rs index c8a5e33..183e70a 100644 --- a/pingora-pool/src/connection.rs +++ b/pingora-pool/src/connection.rs @@ -121,8 +121,8 @@ impl<T> PoolNode<T> { } } - // This function acquires 2 locks and iterates over the entire hot queue - // But it should be fine because remove() rarely happens on a busy PoolNode + // This function acquires 2 locks and iterates over the entire hot queue. + // But it should be fine because remove() rarely happens on a busy PoolNode. /// Remove the item associated with the id from the pool. The item is returned /// if it is found and removed. pub fn remove(&self, id: ID) -> Option<T> { @@ -141,7 +141,7 @@ impl<T> PoolNode<T> { // this is the item, it is already popped return Some(conn); } else { - // not this item, put back to hot queue but it could also be full + // not this item, put back to hot queue, but it could also be full self.insert(conn_id, conn); } } else { @@ -167,7 +167,7 @@ pub struct ConnectionPool<S> { impl<S> ConnectionPool<S> { /// Create a new [ConnectionPool] with a size limit. /// - /// when a connection is released to this pool, the least recently used connection will be dropped. + /// When a connection is released to this pool, the least recently used connection will be dropped. pub fn new(size: usize) -> Self { ConnectionPool { pool: RwLock::new(HashMap::with_capacity(size)), // this is oversized since some connections will have the same key @@ -187,7 +187,7 @@ impl<S> ConnectionPool<S> { { // write lock section let mut pool = self.pool.write(); - // check again since another task might already added it + // check again since another task might have already added it if let Some(v) = pool.get(&key) { return (*v).clone(); } @@ -198,7 +198,7 @@ impl<S> ConnectionPool<S> { } } - // only remove from pool because lru already removed it + // only remove from the pool because lru already removed it fn pop_evicted(&self, meta: &ConnectionMeta) { let pool_node = { let pool = self.pool.read(); @@ -309,7 +309,7 @@ impl<S> ConnectionPool<S> { /// Passively wait to close the connection after the timeout /// /// If this connection is not being picked up or evicted before the timeout is reach, this - /// function will removed it from the pool and close the connection. + /// function will remove it from the pool and close the connection. pub async fn idle_timeout( &self, meta: &ConnectionMeta, |