trio
trio copied to clipboard
Create a Limiter Protocol
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