-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memo docs from community with love. #152
Conversation
docs/memo.md
Outdated
* TTL. Expired values are discarded on access. | ||
* Forced invalidation based on time. | ||
|
||
Missed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess something like Not implemented
would sound a bit better than Missed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry but dont see a point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont like not implemented
at all. It is like a promiss. Changed to a neutral.
docs/memo.md
Outdated
import scala.concurrent.duration.FiniteDuration | ||
import java.util.concurrent.TimeUnit | ||
|
||
def effect[F[_] : Sync]: F[Int] = Sync[F].delay(println("called")) >> 335.pure[F] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is >> 335.pure[F]
intentional? Since you have cats.syntax.functor._
import, you could write that like Sync[F].delay(println("called")).as(335)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
Number 335 | ||
*/ | ||
``` | ||
How it works. Cached value remembers time of read access during update (T_update). On any read access tofu selects a time to compare with T_update (update value when `T_selected > T_update`). Selection is based on a formula `max(T_now - TTL, T_CacheControl)`. If you set `T_CacheControl = T_now` then always T_CacheControl is more than T_update. After update of a value, T_update equals T_CacheControl. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to emphasize the name of the block to make it more distinguishable visually from other text, something like header would do.
Also, not sure about tofu selects
part. Library itself doesn't select
anything, it's an implementation that makes any work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This text is a part of the sample. Why it have be separated?
Library itself doesn't select anything
It's about selection of a computational branch.
No description provided.