Skip to content

docs: clarify Pool::size and Pool::num_idle - #4398

Open
valentynkit wants to merge 1 commit into
transact-rs:mainfrom
valentynkit:docs/pool-connection-counts
Open

docs: clarify Pool::size and Pool::num_idle#4398
valentynkit wants to merge 1 commit into
transact-rs:mainfrom
valentynkit:docs/pool-connection-counts

Conversation

@valentynkit

Copy link
Copy Markdown

Summary

num_idle was documented as returning connections "active and idle", but it only counts idle ones. So the docs were confusing. Drop the mention of active.

size was documented as "currently active. This includes idle connections" which is incomplete and sound strange (idle are not part of active, so should be and). try_increment_size() bumps the counter before the connection is established, so connections still being opened are counted too (nitty detail, but may be worth mentioning).

  • Isn't related to any issue
  • Isn't a breaking change (only docs)

`num_idle` was documented as returning connections "active and idle",
which reads as active plus idle. It only counts idle ones.

`size` was documented as "currently active. This includes idle connections" which is incomplete: `try_increment_size()` bumps the counter before the connection is established, so connections still
being opened are counted too.
@valentynkit
valentynkit marked this pull request as ready for review August 28, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant