Can anyone explain Bulkhead policy in polly
Can anyone explain Bulkhead policy in polly
I want to send API calls to an external API that only allows 10 calls per second. Therefore, I need my program to be limited to making only 10 HTTP calls per second. Additionally, if I encounter a 429 error (too many requests), I want to retry that call. I learned about the Bulkhead pattern from this article: https://medium.com/@ynskrn54/using-polly-and-the-bulkhead-pattern-in-net-f4a9639e2fcd, which helps in preventing overwhelming the external API.
I have written some code based on this pattern. My understanding is that this code will manage 10 calls at a time in a queue. For instance, if I have 30 HTTP calls to make, they will be queued and processed at a rate of 10 calls per second.
Is the below code serve my purpose
I want to send API calls to an external API that only allows 10 calls per second. Therefore, I need my program to be limited to making only 10 HTTP calls per second. Additionally, if I encounter a 429 error (too many requests), I want to retry that call. I learned about the Bulkhead pattern from this article: https://medium.com/@ynskrn54/using-polly-and-the-bulkhead-pattern-in-net-f4a9639e2fcd, which helps in preventing overwhelming the external API.
I have written some code based on this pattern. My understanding is that this code will manage 10 calls at a time in a queue. For instance, if I have 30 HTTP calls to make, they will be queued and processed at a rate of 10 calls per second.
Is the below code serve my purpose
Medium
