StackExchange / StackExchange/StackExchange.Redis
GetSentinelMasterConnection should be included in IConnectionMultiplexer interface
Nobody has claimed this yet.
- 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
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 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