StackExchange / StackExchange/StackExchange.Redis
Leased version of ExecuteAsync for use with custom commands
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.2k
- Forks
- 1.6k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
StringGetLease is great, but I can't use it for Redis Modules and custom commands. My specific use case is that I need to return a large string (actually a byte array) from Redis to parse.
I'm not very familiar with the deep internals of StackExchange.Redis, but I'm wondering how big of a change this will be. Would it be enough to add a new class, ScriptResultLease, that is essentially the same but passes result.AsLease() to SetResult() instead of just result as it does here? Then add ExecuteAsyncLease() with ResultProcessor.ScriptResultLease around here.
Basically I'm wondering how to efficiently read a large byte array from a redis module command without any additional allocations, and if I can't do that today, how big of a change it would require.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/StackExchange.Redis/ResultProcessor.cs at the referenced script result processing and compare it with the lease behavior, then inspect src/StackExchange.Redis/RedisDatabase.cs around ExecuteAsync. Determine whether custom or Redis Module command results can be returned as leases without additional allocations; done means the required API and result-processing behavior are clearly defined and validated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, redis
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100