python-trio / python-trio/trio
Create a Limiter Protocol
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.3k
- Forks
- 431
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 6
Description
Obviously not something to do here, but I'd think it'd make most sense to do a protocol, with only the 6
acquire_*/release_*methods. That's all that a task needs to be limited, the others are only relevant forCapacityLimiter's simple token strategy. The implementations ofacquire()/release()could be included in the protocol since they defer to theon_behalf_ofmethods.
Originally posted by @TeamSpen210 in https://github.com/python-trio/trio/pull/2820#discussion_r1364680964
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked discussion in PR 2820 and the existing CapacityLimiter interface. Determine how the six acquire_/release_ methods and the delegated acquire()/release() methods should be represented in a limiter protocol; done means the intended interface and its implementation impact are settled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100