jeudi 1 décembre 2016

Why we apply delay between retry requests

When we have a piece of code that often fails and must be retried. Then we use retry pattern.

try {
        //do request here
} catch (Exception e) {
        //wait for some millisecond and retry
        retry();
}

We normally delay for some millisecond before retry that request. I want to know that why we need some delay? What will happen if retry request did not wait and send request again.

Aucun commentaire:

Enregistrer un commentaire