StackExchange / StackExchange/StackExchange.Redis

GetSentinelMasterConnection should be included in IConnectionMultiplexer interface

Open
#1,483 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

⚙️ area:sentinel ➕ enhancement 💔 breaking-change
Dominant language
C#
Stars
6.2k
Forks
1.6k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

When using the new sentinel feature, you will have code which calls GetSentinelMasterConnection(..) on a ConnectionMultiplexer instance. For testing/mocking scenarios, GetSentinelMasterConnection(..) should be included in the IConnectionMultiplexer interface, because otherwise you will end up having code which depends on the concrete ConnectionMultiplexer type which is not mockable.
For DI scenarios, you will also most likely want to inject an IConnectionMultiplexer an not the concrete type.

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 locating the IConnectionMultiplexer and ConnectionMultiplexer declarations and comparing the existing GetSentinelMasterConnection(..) API. Add the method to the interface so callers can use it through an IConnectionMultiplexer for mocking and dependency injection; done means the sentinel method is available through the interface without requiring the concrete type.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, redis
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.