Since XMLHttpRequest in JS/Browser and HttpRequest in Dart both allow specifying a timeout to automatically abort requests, the Request object should allow specifying this property.
Fetch doesn't yet support manual cancellation or user-defined timeout, and it could have undesired effects if timeout functionality were implemented in the Http library. For example, if a fetch-backed request timed out in 500ms, and the observable was retried 5 times, there could actually be 5 open connections by the time the retries have run their course. So it's recommended that fetch and other uncancelable backends that do not add their own logic to support cancellation or timeout specification, do not try to manually implement timeout behavior.
JSONP could probably be made to be consistently cancelable, and thus could support timeout.
So the timeout property should be documented as an optimization, only active if the underlying backend supports it.
As part of implementing this feature, the MockConnection should provide a means of fast-forwarding virtual time.
Since
XMLHttpRequestin JS/Browser andHttpRequestin Dart both allow specifying a timeout to automatically abort requests, theRequestobject should allow specifying this property.Fetch doesn't yet support manual cancellation or user-defined timeout, and it could have undesired effects if timeout functionality were implemented in the
Httplibrary. For example, if a fetch-backed request timed out in 500ms, and the observable was retried 5 times, there could actually be 5 open connections by the time the retries have run their course. So it's recommended that fetch and other uncancelable backends that do not add their own logic to support cancellation or timeout specification, do not try to manually implement timeout behavior.JSONP could probably be made to be consistently cancelable, and thus could support timeout.
So the timeout property should be documented as an optimization, only active if the underlying backend supports it.
As part of implementing this feature, the
MockConnectionshould provide a means of fast-forwarding virtual time.