Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Limiting Retries

Give Feedback

Limiting the number of retries is a way of increasing your applications performance. This lesson shows you how to do that by implementing a custom HTTP adapter. If you don’t know about adapters: don’t worry! You’ll learn about them in this lesson, too.

Comments & Discussion

Mahidhar Nyayapati on Oct. 22, 2019

Did not understand the significance of sessions object and retries.

Could you please explain where can sessions object be used. I mean applications.

Why does it mean when you say “requests will not try after a failed request”. How does it work in other applications.

Case1: Payment gateway: If suppose a user clicked the “Pay” button and we set the max_retries > 2. If he does not get a quick feedback, he will surely press the button again and again. In that case he will be paying the same amount multiple times though he requested only once.

Case2: A user forgot his pasowrd and he is trying different combination of passwords, lets say after 10 the website blocks him(Banking sites usually stop at 3). Some websites say “limit exceeded. Try again later.” How do they implement the max_retries in this case.

Become a Member to join the conversation.