App-vNext / Polly

Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. From version 6.0.1, Polly targets .NET Standard 1.1 and 2.0+.
https://www.thepollyproject.org
BSD 3-Clause "New" or "Revised" License
13.4k stars 1.23k forks source link

[docs] Explain partition key #2343

Closed lonix1 closed 1 week ago

lonix1 commented 1 week ago

I'm using the partitioned rate limiter (so I can chain multiple rate limiters), which as far as I understand is based on an implementation by the framework itself.

There is a concept of a "partition key", but it's explained neither in the Polly docs nor in the framework docs. It's also not covered explicitly by anything on StackOverflow.

After trial-and-error I realised:

It would be helpful to add a small explanation in the docs because this was confusing. (I can't submit a PR as I'm still not certain my above understanding is correct).

martincostello commented 1 week ago

That's basically the explanation yes. It's effectively a key for the "shard" to track the counts against, so for a user it might be their user ID for example.

I'll add a brief aside when I add a chained rate limiting example, but if it's not explained at all in the docs for rate limiting itself I suggest opening an issue against the Microsoft documentation to have it explained there.

lonix1 commented 1 week ago

Good idea! I did that here.