Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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