Skip to content

Idea: dynamic expiration of cached action #44

Description

@Vlix

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions