DWR

Allow users to set an alternative error handler for polling errors and to specify a retry policy

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Normal Normal
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 3.0.RC3
  • Component/s: Engine
  • Documentation Required:
    No
  • Description:
    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; };
  1. dwr-poll-error-handler.patch
    (4 kB)
    Ilya Perminov
    27/Apr/07 8:09 PM

Activity

People

Dates

  • Created:
    27/Apr/07 8:07 PM
    Updated:
    07/Dec/12 4:24 AM
    Resolved:
    07/Dec/12 4:24 AM