X Tutup
Skip to content

feat(http): simple, dynamic retrying of failed requests #2810

@jeffbcross

Description

@jeffbcross

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());

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort2: daysfeatureLabel used to distinguish feature request from other issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup