-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Labels
effort2: daysfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issues
Description
In both Dart and JavaScript, there should be a common way to perform simple retries of failed requests, and a way to provide logic to determine whether or not a request should be retried. Functionality should be on top of retry and retryWhen methods of RxJS for the JavaScript side. For Dart, I think a wrapper would have to be created to create new streams when previous streams error.
The API may look something like this
var req = new Request({url: 'https://foo'});
//Simple retry
//Will try request up to three times before giving up and propagating error/completing.
http.try(req, 3).subscribe(res => this.data = res.json());
//Dynamic retry.
//Will try up to 3 times as long as status is 500
http.tryWhen(req, 3, res => res.status === 500).subscribe(res => this.data = res.json());Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
effort2: daysfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issues