Skip to content

Conversation

@ithinkicancode
Copy link
Contributor

Resolves #39

* will be returned to all fibers.
*/
sealed abstract class Cache[-Key, +Error, +Value] {
sealed abstract class Cache[-Key, +Error, Value] {
Copy link
Contributor

Choose a reason for hiding this comment

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

The loss of variance is a significant downside here. We should try to push this functionality into the Lookup function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll rework it... Yeah, I encountered some problem with variance. Tried doing [V >: Value] but the underlying Hashmap/ConcurrentHashmap is invariant. As a compromise, I made Value invariant, hence the draft :)

Let me rework this. Thanks Adam.

Copy link

@giordanoj giordanoj Jul 21, 2023

Choose a reason for hiding this comment

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

@adamgfraser did you have any additional thoughts on how to push this into Lookup. I've been playing around with it a little without much luck. Tried adding a get function that accepts a custom/temporary lookup, but gets messy because you have to add that to the interface level as well

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.

Ability to add cache entries directly, bypassing the Lookup function

3 participants