Repository navigation
feat(pool): port runtime-agnostic object pools - #177
Merged
Merged
Conversation
tisonkun
marked this pull request as ready for review
August 23, 2026 16:36
Member
Author
|
I'll merge this patch now and see if we will have a good shape of object pools in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
poolfeature backed by Asyncband's semaphorepoolfeature free of third-party normal dependenciesThe code is ported from Fastpool v1.1.1 (
e4c65f1).Why this is a draft
This is a concrete prototype for #176, not a final decision that object pools belong in the main crate. It chooses the main-crate feature shape so we can review the real API, dependency, documentation, and project-positioning consequences.
The provisional boundary demonstrated here is: Asyncband may own runtime-agnostic reusable-resource lifecycle and synchronization, but it does not own clocks, runtime integration, task spawning, or scheduling.
Proposed API shape
The feature is defined as
pool = ["semaphore"]. Bounded pools use Asyncband's owned semaphore permits; both pool variants use the sharedManageObject,ObjectStatus, queue strategy, cancellation strategy, and retain result types.Bounded-pool user accounting uses a small private guard. It rolls the count back when
get()fails or is cancelled, and is intended to be replaced by the standard library'sDropGuardif that API stabilizes.Timeouts remain caller-side composition:
Review questions
asyncband::pool::{bounded, unbounded}the right namespace and API surface?Validation
cargo x lintcargo x checkcargo x test --no-capturecargo tree -p asyncband --no-default-features --features pool -e normalcargo publish --package asyncband --locked --dry-runRefs #176