Comments (2)
Hi. You are right; dash::Cache
has no get_with
(or get_or_insert_with
).
A bit of history; we added the experimental dash::Cache
for the following reasons:
- A user wanted to ensure never to get an issue: #34
- The segmentation fault was occurring in our concurrent lock-free hash table implementation
moka::cht
. moka::cht
is used bysync
andfuture
caches.
- The segmentation fault was occurring in our concurrent lock-free hash table implementation
- The same user wanted to reduce external crate dependencies. e.g. Remove crossbeam-epoch crate that is used by
moka::cht
.
We used dashmap::DashMap
as an alternative concurrent hash table. However, implementing get_with
method on it would require a non trivial amount of work, so we decided not to do it.
Now Moka v0.9.2 was just released with the fix for issue #34. So if you wanted to use dash::Cache
just because to avoid the issue, you no longer have to use it. If so, please use sync::Cache
or future::Cache
instead.
from moka.
I am closing this. Feel free to reopen if you find sync::Cache
or future::Cache
do not meet your requirements.
from moka.
Related Issues (20)
- Add new api similar to `try_get_with`, but return `Option` rather than `Result`? HOT 6
- Is it worth to modify the key of `get_with` as a `&K` rather than `K`? HOT 10
- Help with size based eviction that weighs with bytes HOT 2
- moka is too polymorphic (cargo-llvm-lines) HOT 3
- Setting number of segments will disable notifications HOT 2
- try_get_with always runs init future HOT 4
- Staggering expiry with TTL HOT 1
- Moka `get_with` inflates future size by ~7x HOT 14
- how to use build_with_hash? HOT 3
- Clarify is_fresh() with regard to concurrent insert_with() HOT 3
- Entry `and_compute` method for performing an insert, update, or remove operation with single closure HOT 9
- Add support for `Immediate` notification delivery mode to `future` cache HOT 1
- [help] Conditionally disabling the cache, and logging when data retrieved from cache HOT 8
- Cache with max capacity of zero should not cache anything
- Proposal: support insert key with expire time? HOT 16
- CI: Disable external CI services on temporary merge-queue branches?
- Statistics for metrics HOT 3
- `get_with` deadlock HOT 13
- `.blocking().invalidate(key)` doesn't trigger eviction listener HOT 1
- RUSTSEC-2020-0168: mach is unmaintained HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moka.