API suggestion: add ROM for Lua+exec #2346
Draft
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.
only Lua implemented for now, to discuss API shape
ReadOnlyMemory<T>
API for LuaReadOnlyMemory<object>
for exec (modules)? or try to be more clever? maybe a newreadonly struct RedisKeyOrValue
which is a known union of the two, and aReadOnlyMemory<RedisKeyOrValue>
? (at the moment we takeobject
because the API can't know the positions of key vs non-key args, and we need to know which are keys for routing - but usingobject
forces a lot of boxing)ReadOnlyMemory<T>
APIs?mget
?hmget
?del
?touch
?mset
?hset
?IServer
path? not sureIServer
needs super optimize[Loaded]LuaScript
to exploit this with leased buffers? (I am not a fan of that API)in particular note the lease approach used in the key-prefix path
discussion topic: any usage passing the literals
null
ordefault
as the currentRedisKey[] keys
arg is now ambiguous due to the single-key overload (RedisKey
has some operators); this is source-breaking, but is trivially fixable. How much do we care about that? in reality, the number of Lua scripts that don't take any keys can be approximated as zero, so I do not anticipate this impacting much code.