StackExchange.Redis icon indicating copy to clipboard operation
StackExchange.Redis copied to clipboard

Change DefaultOptionsProvider.AfterConnectAsync to receive an IConnectionMultiplexer rather than ConnectionMultiplexer?

Open philon-msft opened this issue 2 years ago • 3 comments
trafficstars

Receiving the interface rather than class type would make it easier to unit test custom options providers, and would seem to align better with using interfaces as the public API surface.

Of course this would require a change to the public API, and some adjustments within the library itself. Thoughts?

Current:

public virtual Task AfterConnectAsync(ConnectionMultiplexer multiplexer, Action<string> log) => Task.CompletedTask;

Proposed:

public virtual Task AfterConnectAsync(IConnectionMultiplexer multiplexer, Action<string> log) => Task.CompletedTask;

philon-msft avatar Apr 23 '23 14:04 philon-msft

If we were starting fresh: yeah, sure, but now that it's in I wouldn't binary break for this - not worth a 3.x release :) Though we can look at doing so in 3.x!

NickCraver avatar Apr 23 '23 15:04 NickCraver

Should we introduce a label like "considerFor3x" to tag things like this and easily find them later?

philon-msft avatar Apr 23 '23 15:04 philon-msft

Gotcha covered :)

NickCraver avatar Apr 23 '23 15:04 NickCraver