StackExchange / StackExchange/StackExchange.Redis

Option to create RedisKey from ReadOnlyMemory<byte>

Open
#2,758 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.2k
Forks
1.6k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

I'd love to have the option to create RedisKeys from ReadOnlyMemory so we don't need to allocate an extra object on the heap every time a key is created. I do understand that there could occur some challenges in an async environment, if the key is disposed before it's used, but maybe there's a solution for that?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing RedisKey creation API and how ReadOnlyMemory values would be used in asynchronous operations. Determine a safe ownership or lifetime approach, then verify that callers can create keys without an extra heap allocation and that disposed memory cannot be used afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, redis
Domain
backend-api-design, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.