When handling caching of access tokens, they might have expiration times that are not predictable. So when the cached action tries to refresh the value, it might also get an expiration time that won't be static as a result of the refresh action.
It would be nice to be able to change the refresh time of the cached action depending on the result of the cached action.
So instead of
isCacheStillFresh :: (UTCTime -> UTCTime -> Bool)
we'd want
isCacheStillFresh :: (MonadIO m) => (UTCTime -> UTCTime -> m Bool)
so a user could define their own function using IORefs or TVars that they also update in the refresh action.
When handling caching of access tokens, they might have expiration times that are not predictable. So when the cached action tries to refresh the value, it might also get an expiration time that won't be static as a result of the refresh action.
It would be nice to be able to change the refresh time of the cached action depending on the result of the cached action.
So instead of
isCacheStillFresh :: (UTCTime -> UTCTime -> Bool)we'd want
isCacheStillFresh :: (MonadIO m) => (UTCTime -> UTCTime -> m Bool)so a user could define their own function using
IORefs orTVars that they also update in the refresh action.