taoensso / carmine

Redis client + message queue for Clojure
https://www.taoensso.com/carmine
Eclipse Public License 1.0
1.16k stars 131 forks source link

Support options for `EXPIRE` command #285

Closed olttwa closed 1 year ago

olttwa commented 1 year ago

Hey @ptaoussanis, Hope you are doing well! 👋

I wanted to use an option with the EXPIRE command. Carmine's native expire function only supports 2 args: key & seconds. Would it be possible to add support for a variadic option [NX | XX | GT | LT]?

Thanks!

ptaoussanis commented 1 year ago

Hi there, please see here

olttwa commented 1 year ago

Thanks @ptaoussanis. I'll use redis-call until options are supported in Carmine.

On a side-note, can you double-check if Carmine's command generation from spec logic is correct?

Redis spec has specified optional conditions, and the same can be seen in carmine-commands.edn as well under :fn-params-more [key seconds & args]. However, car/expire only takes 2 args: key & seconds. The parser seems to be working correctly for other commands taking variadic number of args like HSET

olttwa commented 1 year ago

I updated Carmine from 3.1.0 to 3.3.0-RC1, and the expire command has support for options in newer version.

Closing this issue, thanks.