Hide
In 2.0 pollErrorHandler is not customizable and the retry policy is hard coded. An application may want to be notified when reverse AJAX failed and to specify the number
of retries and delays between them (e.g. in a clustered environment, we want to retry without a delay a couple of times and then increase the delay).
I suggest to add an additional user-level error handler, which takes a retry number (in addition to the error message) and returns the next retry delay or -1 to cancel retrying.
For example, a handler, which implements the current retry policy:
function(message, ex, retryNum) {
// if anything goes wrong then just silently try again (up to 3x) after 10s
return retryNum < 3 ? 10000 : -1;
};
Show
In 2.0 pollErrorHandler is not customizable and the retry policy is hard coded. An application may want to be notified when reverse AJAX failed and to specify the number
of retries and delays between them (e.g. in a clustered environment, we want to retry without a delay a couple of times and then increase the delay).
I suggest to add an additional user-level error handler, which takes a retry number (in addition to the error message) and returns the next retry delay or -1 to cancel retrying.
For example, a handler, which implements the current retry policy:
function(message, ex, retryNum) {
// if anything goes wrong then just silently try again (up to 3x) after 10s
return retryNum < 3 ? 10000 : -1;
};