Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
azproduction committed Nov 24, 2013
1 parent b74cb4b commit 9979b7b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ For example, user of your service have some critical data and you want to delive
User browsing under unstable and slow cellular network. You may give up on first fail or try to fix this problem,
using callback hell or use this solution :)

Assume you have rule which defines behaviour of sending requests:
- status >= 500 - no reason to repeat, your server totally down
- status = 400 - no reason to repeat, something wrong with input data
- each next repeat should be performed in N * 500ms where N is attempt number
- status = 0 (aka abort) - repeat
- if number of repeats is more than 5 - ask user what repeat or not
Assume you have rule which defines behaviour of repeating requests:
- each next repeat should be performed in `N * 500ms`, where N is attempt number
- `error.status >= 500` - no reason to repeat, your server totally down
- `error.status === 400` - no reason to repeat, something wrong with input data
- `error.status === 0` (aka abort) - repeat
- if number of repeats is more than 5 - ask user continue to repeat or not
- if number of repeats is more than 10 - do not repeat

And instead of calling promise directly
Expand Down

0 comments on commit 9979b7b

Please sign in to comment.