Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a Limiter Protocol #2824

Open
jakkdl opened this issue Oct 19, 2023 · 0 comments
Open

Create a Limiter Protocol #2824

jakkdl opened this issue Oct 19, 2023 · 0 comments
Labels
typing Adding static types to trio's interface

Comments

@jakkdl
Copy link
Member

jakkdl commented Oct 19, 2023

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 for CapacityLimiter's simple token strategy. The implementations of acquire()/release() could be included in the protocol since they defer to the on_behalf_of methods.

Originally posted by @TeamSpen210 in #2820 (comment)

@A5rocks A5rocks added the typing Adding static types to trio's interface label Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typing Adding static types to trio's interface
Projects
None yet
Development

No branches or pull requests

2 participants