Skip to content
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.

Add a retry feature for synchronous requests #16

Merged
merged 1 commit into from
Jun 3, 2015

Conversation

fabdsp
Copy link
Contributor

@fabdsp fabdsp commented Jun 2, 2015

To add a retry feature for the synchronous requests.

I have no idea how to add a retry for asynchronous requests.

@fabdsp fabdsp force-pushed the feature/retry-sync-requests branch from f1992fd to 8e0c453 Compare June 2, 2015 09:26
@mojoLyon
Copy link
Contributor

mojoLyon commented Jun 2, 2015

Can you report option in the Configuration reference in README ?

@fabdsp
Copy link
Contributor Author

fabdsp commented Jun 2, 2015

Done ;-)

@fabdsp fabdsp force-pushed the feature/retry-sync-requests branch from 64a89e0 to 9320080 Compare June 2, 2015 15:44
// Reset the current session to retry the command
$this->resetSession();
$retry--;
} else {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je suis un peu un puriste du pas de else. Donc tu pourrais modifier comme cela

if($retry > 0) {
    $this->resetSession();
    $retry--;
    continue;
}
throw $e;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai justement essayé de ne pas faire de break / continue dans cette boucle (sinon j'aurais fait un while(true) ... break; continue... ;-))

Il y a d'autres puristes dans le coin qui vont dire qu'ils n'aiment pas les break et les continues ;-)

En plus on peut vouloir ajouter des choses du code après le catch ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@Fabex
Copy link

Fabex commented Jun 3, 2015

👍

@mojoLyon
Copy link
Contributor

mojoLyon commented Jun 3, 2015

👍

Squash commits then I merge it

@fabdsp fabdsp force-pushed the feature/retry-sync-requests branch from 9320080 to 9b1fe65 Compare June 3, 2015 12:16
@fabdsp
Copy link
Contributor Author

fabdsp commented Jun 3, 2015

Squashed ;-)

mojoLyon added a commit that referenced this pull request Jun 3, 2015
Add a retry feature for synchronous requests
@mojoLyon mojoLyon merged commit a229961 into master Jun 3, 2015
@mojoLyon mojoLyon deleted the feature/retry-sync-requests branch June 3, 2015 14:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants