This assumes that the APIs work this way?
What if the first call is to get a resource that expires and then the last call fails?
Now it will retry but with an expired resource (first call is saved).
What if the first call is to get a resource that expires and then the last call fails?
Now it will retry but with an expired resource (first call is saved).
Success! Your widget expires in 30 seconds
Second call: use widget
Failure! For some reason or another
Ok, so restart the flow…
First call: fetch a widget
Cached! Receive the same widget again
Second call: use widget
Failure! widget has now expired