amitmerchant1990 / amitmerchant-dot-com-comments

1 stars 0 forks source link

retry-operations-with-high-probability-of-failure-in-laravel/ #16

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Retry operations with high probability of failure in Laravel – Amit Merchant – A blog on PHP, JavaScript and more

There are certain operations that can have a high probability of failure. For instance, sending a request to a third-party API. You’re not sure whether it will work every time flawlessly because it’s not in your control. If the API endpoint you’re hitting is not responding, you might end up with an exception straight away.

https://www.amitmerchant.com/retry-operations-with-high-probability-of-failure-in-laravel/

mitchy-crypto commented 3 years ago

$response = Http::retries(3, 200)->get('http://example.com/users/1');

I think it should be retry, not retries. i.e

$response = Http::retry(3, 200)->get('http://example.com/users/1');