GithubHelp home page GithubHelp logo

Comments (8)

JohnSully avatar JohnSully commented on June 11, 2024 2

This has been merged into the unstable branch in prep for its v5.1 release. The unstable docker updates at 4am EST each night if you would like to try it via docker.

from keydb.

JohnSully avatar JohnSully commented on June 11, 2024 1

A prototype of EXPIREMEMBER is now in the subexpire branch: https://github.com/JohnSully/KeyDB/tree/subexpire

The command is: EXPIREMEMBER [key] [subkey] [seconds]

This is still a prototype so please don't try this in production - but I think this feature will work very well. I'd love to hear any suggestions you have for improving this command. Right now only sets are supported but this is a temporary limitation.

I will continue to update this issue as the feature makes it way to our stable release.

from keydb.

JohnSully avatar JohnSully commented on June 11, 2024 1

Thanks @vfrz this is an oversite. I'll add a new subexpire keyspace event so you can track them.

from keydb.

JohnSully avatar JohnSully commented on June 11, 2024 1

@vfrz I moved your feature request to a new issue #85. Because I'm hoping to release v5.1 on Monday there won't be time to do it as part of that release.

from keydb.

JohnSully avatar JohnSully commented on June 11, 2024

Its good timing since Iā€™m already looking at the expire code heavily.

What do you think of triggering a lua script on expire? The script would be able to remove the desired element and reset the expiration. That way custom behavior can be added for any type as needed.

The one hesitation I have is if you have this ability for sets - then what about the other set-like data types?

from keydb.

imtrobin avatar imtrobin commented on June 11, 2024

I would foresee other types like hashes too. I'm not a great fan of calling another script. My use case is quite simple, without expire on individual keys in a set, I'm forced to put them in global space, and there will be collisions.

Perhaps I would think it's an extenion method, like EXPIREMEMBER

from keydb.

imtrobin avatar imtrobin commented on June 11, 2024

Looks good, thanks!

from keydb.

vfrz avatar vfrz commented on June 11, 2024

Hello @JohnSully ,
I am very happy to have found this fork which support member expiration. I've tested it and it works very well.
However there is a feature I'd like to see: have the possibility to know/get the deleted value on the "notify-keyspace-events" notification system. Currently, we can only get the key of the set by parsing the channel.
To be honest, I've just started digging into Redis/KeyDB and I don't know much about it, so I don't even know if it's possible to add this feature without rewriting the whole project.

So, do you think that's possible? And if yes, would you agree to implement it? (Or maybe it's already possible?)

Thanks in advance.

from keydb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.