-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Redis.zep #16251
base: master
Are you sure you want to change the base?
Update Redis.zep #16251
Conversation
add ttl() and pttl() to that developer can get Redis TTL.
@zikezhang Could you please add some basic tests for theses methods? |
Co-authored-by: Anton Vasiliev <[email protected]>
add function to return the time to live left for a given key in seconds (ttl), or milliseconds (pttl).
Hi @Jeckerson, yes, I will. I am sorry for the inconvenience. So, one of my project, I need to implement a throttle middleware by updating the value in Redis without changing the TTL. I have to code it like this: $ttl = $hits ? $cache->getAdapter()->getAdapter()->ttl($key)
: $minutes * 60; As you can see. I have to call |
Adding this to the Cache layer will alter the interface and we will need to add all these methods to the adapters and relevant interface also We need to explore what the other adapters offer in terms of TTL so as to promote it to the adapter. Also the Cache adapters rely on the Storage namespace so all changes have to happen there first. |
apcu has this on https://www.php.net/manual/en/function.apcu-key-info.php Memcached has something called MetaCommands, unfortunately php-memcached is heavily reliant on libmemcached that is a bit behind. There is a project https://github.com/awesomized/libmemcached that is trying to implement the meta protocol for the past 3 years. |
add ttl() and pttl() to that developer can get Redis TTL.
Hello!
In raising this pull request, I confirm the following:
Small description of change:
add ttl(), pttl() for Redis.
Thanks