James Kominick
James Kominick
I've thought about this a bit, but haven't gotten to the point of trying to write any code related to it. Seems to boil down to two areas of interest...
Yes, there does appear to be a bug. `cache_set` and `cache_remove` should be checking the timestamp of the existing value before returning. It looks like the `TimedSized` store has the...
The insert/remove bug is fixed by this commit https://github.com/jaemk/cached/commit/d5ac5fe27181e49078fa9e172a749609a0bd6514 and a new `flush` method was added to the timed and timed-sized caches in this commit https://github.com/jaemk/cached/commit/26ef57a749ae64db4c70f88ebf293836afd35b3d . `cache_get` will delete...
The latest version (`0.26.1`) adds an option `sync_writes` to the `#[cached]` macro to support this - see https://github.com/jaemk/cached/commit/fb88d7f8bbb32f1cf35f91ad0a1dd5357dfd4725 ```rust #[cached(size=100, option = true, sync_writes = true)] fn do_stuff(a: String) ->...
Sure, but that would only be compatible with simple unbounded and timed caches since any LRU/size-enforcement requires exclusive access of the entire cache for reads and writes. If, say, a...
Just checking - using `futures_lite` won't affect compatibility with any existing users of this crate, right?
Hi @axos88 , the ability to prime a `#[cached]` function was just recently added. You should be able to implement the logic you're describing by priming your cached-fn after 24hrs...
yeah, I'm going to guess it's this line being naive https://github.com/jaemk/cached/blob/4d7dea23697488b54af28bd17904e53dcd05f07a/cached_proc_macro/src/lib.rs#L93
This should be fixed now, released in `0.29.0` https://github.com/jaemk/cached/blob/e24d7a739dd112e8857581cb6538191fbde038f2/tests/cached.rs#L1144-L1155
That's an interesting case. I've just released some changes to support this in `0.27.0`. Unfortunately, it's not something simple enough that I think it should handled completely by the `#[cached]`...