-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Support MSETEX #2977
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
base: main
Are you sure you want to change the base?
Support MSETEX #2977
Conversation
|
I'd vote for making ExpiryToken a first class citizen. Seems like that would help people find the type of expiry that's right for them (more helpful than having a profusion of method overloads to read through) |
|
K, I'll tweak the PR to model that. That was my exact thoughts, too. Also: it'll match what I'm working on for CAS/CAD (aka |
|
@philon-msft new |
Redis 8.4.0 is due to add
MSETEX(see redis/redis#14434 and redis/redis#14470)Here we:
StringSet[Async]APIs that take optional relative expiration via overloadExpiryTokenfor simplicity and performance (note existing unit tests)Messagesubclass that natively and efficiently supportsMSETEX,MSETNXandMSET, and use that for the new APIOpen design question (please discuss):
Expiration is a PITA to express, because we have multiple overlapping concepts:
DateTime) -EXAT/PXATTimeSpan) -EX/PXKEEPTTLPERSISTInternally, we use
ExpiryTokento represent these efficiently, allowing a single API that expresses all of these intents. For the new API, I have only added relative expiration, but conceptually the code also supports absolute. Should we:TimeSpan/DateTime/etc overloads, orExpiryToken(presumably renaming it and making the API suitable for public callers) a first class citizen, i.e. we make this the first example of APIs with a newRedisExpiry(or whatever) parameter, rather than complicated overloads - and the caller specifies expiration from thereFix #2892
Note that CI will be dependent on access to a suitable server, i.e. #2976