Skip to content

Conversation

naixx
Copy link

@naixx naixx commented Jul 14, 2014

There is question about SoftCachedObject and its usefullness

@iainconnor
Copy link
Owner

The purpose of SoftCachedObject is to signify to the "client" that they are getting back the object, but it's expired so this is their last chance to refresh it.

I added it to fulfill the specific example in an application I'm using this library in where we cache the current logged in user, and then periodically poll the API to refresh all of their information (in case they changed their avatar or something). So, we need SoftCachedObject as a moment-of-no-return to fetch their user id and re-retrieve that model from the API.

@naixx
Copy link
Author

naixx commented Jul 16, 2014

So, one method returns two types of objects? Wouldn't it be better to have separate method to check and explicitly return object of type T?

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.

2 participants