add ReadOnlyMemory<RedisKeyOrValue> and Lease<byte> for Lua and Execute - #3201
add ReadOnlyMemory<RedisKeyOrValue> and Lease<byte> for Lua and Execute#3201pairbit wants to merge 11 commits into
Conversation
* add RedisKeyOrValue * add operators and override to RedisKeyOrValue * add ThrowInvalidCast * add IScriptRequestDisposer * ScriptEvaluateMemory * ScriptEvaluateMemoryReadOnlyAsync * ScriptEvalMemoryMessage * fix bug ScriptUnavailable ScriptEvaluateReadOnlyAsync * add Lease ScriptEvaluateMemory * add Prefixed * FromKey FromValue * undo Disposer
|
There's a couple of reasons I've been deferring on this for a little bit... If we're thinking "efficiency", there's the problem of the return value, and managing it in a way that is flexible and efficient. I'm not quite ready to release it on the world yet, but a large part of the IO rewrite is "yet to come", and explicitly targets flexible read / write custom command scenarios, including Lua (but also any ad-hoc commands). I'm torn between compromising on an eval[sha] now, bs giving you the real thing "soon" - trust me, it'll be much easier than this. Thoughts? |
|
I understand that you want to give the maximum. But the perfect is the enemy of the good. The solution I propose will completely satisfy many and will be a compromise. For most tasks, the current solution will be sufficient. But I understand it's not perfect. I'd really appreciate your consideration of my merge request. It's a good temporary compromise. |
|
I'm currently in dire need of the ScriptEvaluateLease and ExecuteLease methods. If you don't like the idea of introducing a new RedisKeyOrValue or ScriptRequestDisposer type, I'm willing to live with their absence. I am willing to listen to your terms on which you would agree to add methods with a Lease return. I apologize for being stubborn, I have been waiting for these changes for a very long time. |
|
I'll try to look today. Balancing competing needs is always tricky. I'm not against reasonable APIs. The return value is the trickiest bit, since this can technically be an arbitrary tree of different data types. Thinking outside of the box: how might a lease + RespReader work for you? I.e. the lease isn't a value, but an API over the tree? If you're accessing a scalar or BLOB: this is then one line to get the blob, and I could provide helper APIs for those. |
|
I understand that the
Returning lease + RespReader would be a great solution! After the review, please give me your opinion on my idea with |
Tasks:
ReadOnlyMemory<RedisKeyOrValue>API for LuaLease<byte>?API for LuaScriptEvaluateReadOnlyAsyncagain if the script does not exist.ReadOnlyMemory<RedisKeyOrValue>API for ExecuteLease<byte>?API for ExecuteLinks
#2346
#2843
#2844
Please consider this PR, this issue has been raised for a long time