Skip to content

Commit 142d2fb

Browse files
authored
chore: prepare for release 1.0 (#15)
Signed-off-by: tison <wander4096@gmail.com>
1 parent 2abb585 commit 142d2fb

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fastpool/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
name = "fastpool"
1717

1818
description = "This crates implements a fast object pool for Async Rust."
19-
version = "0.4.2"
19+
version = "1.0.0"
2020

2121
edition.workspace = true
2222
homepage.workspace = true

fastpool/src/bounded.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,16 @@ impl<M: ManageObject> Pool<M> {
195195
})
196196
}
197197

198-
/// Replenishes the pool with at most `most` number of new objects.
198+
/// Replenishes the pool with at most `most` number of new objects:
199199
///
200-
/// Returns the number of objects that are actually replenished to the pool.
200+
/// 1. If the pool has fewer slots to fill than `most`, narrow `most` to the number of slots.
201+
/// 2. If there is already any idle object in the pool, decrease `most` by the number of idle
202+
/// objects.
203+
/// 3. If [`ManageObject::create`] returns `Err`, reduces `most` by 1 and continues to the next.
204+
///
205+
/// Returns the number of objects that are actually replenished to the pool. This method is
206+
/// suitable to implement functionalities like minimal idle connections in a connection
207+
/// pool.
201208
pub async fn replenish(&self, most: usize) -> usize {
202209
let mut permit = {
203210
let mut n = most;

0 commit comments

Comments
 (0)