dart-archive / http_retry

HTTP client middleware that automatically retries requests
https://pub.dev/packages/http_retry
BSD 3-Clause "New" or "Revised" License
13 stars 10 forks source link

Add a timeout parameter to fail then retry requests after an amount of time #14

Closed CorvetteCole closed 2 years ago

CorvetteCole commented 4 years ago

I previously submitted a pull request for this, but... my code was utter garbage. I've gotten a lot better at Dart and I think this one is up to the standard for this library.

It does not break any past usages and only provides an extra useful option moving forward.

I have also written a few tests to verify that this works as intended.

Let me know if any other code changes are need.

CorvetteCole commented 4 years ago

Hate to annoy you folks, but I'd love to get this merged @kevmoo. Would be a joy not having to use my forked library in my projects every time

CorvetteCole commented 4 years ago

I know you guys are busy but any update on this @natebosch ?

natebosch commented 4 years ago

It may be a day or two before I can take a closer look.

At a high level I worry that this might not be the best place to add this functionality, but I'll have to give it some thought.

CorvetteCole commented 4 years ago

Thanks, sounds good! I thought about it as well, but this felt like a natural place since it already handles all the retry stuff already. Hate having a separate retry setup for timeouts because a network switch occurred during the request or something.

natebosch commented 4 years ago

Sorry for the silence on this. I'm holding off a bit longer because we are working towards adding an abort capability to package:http. I think a timeout would be better implemented on top of that than here.