You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While refactoring the ApiClientBase calls, I wanted to find a way to ensure that regardless of the call/operation being performed, I could easily see if it was a failure or a success. In the EF core providers, there is a behaviour called ExecutionStrategy that allows providers to implement things such as retries. With every single response being a different object, and with the exceptions being handled differently again, there would be almost no way to say "Run this generic operation, and if it fails, try it again"... there would need to be code specific to each response.
However, my implementation is not entirely consistent, because there are some areas where the standard ResponseDetails property an end up null when it shouldn't be. That's purely down to me not being consistent and making certain choices before I worked through the whole api. Those will need to be fixed to ensure that the property is never empty.
The text was updated successfully, but these errors were encountered:
Run this generic operation, and if it fails, try it again
What about creating a custom transport? You can implement a specific IApiClientTransport interface to provide the retry logic, or maybe extend the existing HttpApiTransport?
That way you have access to all requests and the full response properties to decide what to do.
Follow up from #201
While refactoring the ApiClientBase calls, I wanted to find a way to ensure that regardless of the call/operation being performed, I could easily see if it was a failure or a success. In the EF core providers, there is a behaviour called ExecutionStrategy that allows providers to implement things such as retries. With every single response being a different object, and with the exceptions being handled differently again, there would be almost no way to say "Run this generic operation, and if it fails, try it again"... there would need to be code specific to each response.
However, my implementation is not entirely consistent, because there are some areas where the standard ResponseDetails property an end up null when it shouldn't be. That's purely down to me not being consistent and making certain choices before I worked through the whole api. Those will need to be fixed to ensure that the property is never empty.
The text was updated successfully, but these errors were encountered: