Comments (4)
At least you could provide an additional set of get
methods that takes a closure, such as get_with
, so the option is available for larger types.
from concache.
Ideally we wouldn't require Copy
or Clone
, but sadly they're required to provide the get
interface we currently have (i.e., fn get(&self, key) -> V
). Because of the nature of the concurrent map, we can't easily provide get(..) -> &V
like traditional maps. The likely path forward here is to have get
take a closure that is given &V
, but that requires some more work on our part.
The reason we currently require Copy
over Clone
is to discourage users from using values that are expensive to clone in the map (since their get
would become pretty slow). That might not be a good way to do so, but I think I'd rather see a move to get
with a closure rather than moving to Clone
. @andrewtshen @saligrama what do you think?
from concache.
I completely agree! The codebase belongs to @andrewtshen and @saligrama though — I'm just mentoring them — so I'll let them make the final call.
from concache.
Yea, that definitely seems like a good addition, I'll try to add that if I have time
from concache.
Related Issues (6)
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 concache.