Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@adamgfraser
Copy link
Contributor

We've gotten several requests recently for a variant of cached that allows the caller to invalidate the cache before the timeToLive has expired. This is potentially getting a little specialized but given user demand I think it makes sense to add and we can implement the current cached operator in terms of this one so it is not adding much new code.

@remiguittaut
Copy link
Contributor

That's really great and a much awaited feature! Just a comment though, I'm not sure about the naming, it doesn't tell me if I don't know that this combinator gives me the possibility to invalidate. cachedInvalidate maybe?

@adamgfraser
Copy link
Contributor Author

@remiguittaut Yes, I wasn't sure about the name. Changed it based on your suggestion. Open to other ideas as well.

@adamgfraser adamgfraser requested a review from jdegoes February 18, 2021 12:47
} yield assert((a, b, c))(equalTo((0, 0, 0)))
}
),
suite("cachedWith")(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
suite("cachedWith")(
suite("cachedInvalidate")(

@jdegoes jdegoes merged commit 633c7f8 into zio:master Feb 27, 2021
@adamgfraser adamgfraser changed the title Implement ZIO#cachedWith Implement ZIO#cachedInvalidate Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants