Comments (3)
@rektide Do you really need that? What is the specific use case?
I'm not sure is it wise to provide it, also it may appear it'll bad for performance when used
e.g. if we would want to change maxAge on already setup memoized function, then for each already saved results we need to know how much time passed since they were cached (this information is not stored now), and either we need to clear them or replace their timeouts with new ones (that can be heavy for large number of items).
So this functionality may contradict idea of memoization, which is about saving resources, not sure if it's really worth it
from memoizee.
I have two cases I'm working with needing variable lifetimes- a data connection pool with near/far connections needing different lifecycles, and an implementation of etcd, which allows objects posted to be tagged with a TTL.
It'd be fine to not update retroactively. That's certainly something that can be done at a higher level easily, once there's some kind of finer granularity in memoize.
from memoizee.
a data connection pool with near/far connections needing different lifecycles
Wouldn't it be better for each lifecycle to have different memoized function configured?
and an implementation of etcd, which allows objects posted to be tagged with a TTL
That seems make sense. It may work as following:
// Timeout needs to be configured before function is invoked
memoizedFn.configureTimeout(timeout, ...args);
// Invoke function
memoizedFn(...args); // preset timeout is taken into account
It'd be fine to not update retroactively.
Yes, I guess if we'll implement it, it'll be strictly for future hits, no ongoing timeouts would be affected.
from memoizee.
Related Issues (20)
- Callback for cache access HOT 5
- setter method HOT 1
- How to deal with functions taking dict args? HOT 6
- Rollup fails to bundle memoizee correctly HOT 6
- feat: let default nomalizer be more general HOT 1
- replace `es5-ext` with `core-js@^3` HOT 2
- Cannot import memoizee HOT 3
- Memoizing a function without arguments HOT 1
- Allow `maxAgeSinceAccess` in addition to `maxAge` HOT 11
- Why is the memoizee so slow? HOT 2
- Is there a way to dynamically configure the size? HOT 7
- Feature Request: Wouldn't it be good if we could use a Redis backend? HOT 2
- max option does not work with promise option HOT 1
- Option to return prior cached value on update failure HOT 5
- Package is showing a vulnerability HOT 7
- [email protected] is broken due to node requirement HOT 10
- typo in engines.node HOT 20
- Found a mistake here that breaks our Pipeline HOT 2
- Codecov badge HOT 2
- Memory leak when using `maxAge` on node.js 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 memoizee.