Skip to content

Commit 8476651

Browse files
authored
Add IConnectionMultiplexer.ServerMaintenanceEvent (#2306)
Fixing a few requests here.
1 parent f3ac74a commit 8476651

4 files changed

Lines changed: 15 additions & 0 deletions

File tree

docs/ReleaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Current package versions:
1010

1111
- Fix [#1520](https://github.com/StackExchange/StackExchange.Redis/issues/1520) & [#1660](https://github.com/StackExchange/StackExchange.Redis/issues/1660): When `MOVED` is encountered from a cluster, a reconfigure will happen proactively to react to cluster changes ASAP ([#2286 by NickCraver](https://github.com/StackExchange/StackExchange.Redis/pull/2286))
1212
- Fix [#2249](https://github.com/StackExchange/StackExchange.Redis/issues/2249): Properly handle a `fail` state (new `ClusterNode.IsFail` property) for `CLUSTER NODES` and expose `fail?` as a property (`IsPossiblyFail`) as well ([#2288 by NickCraver](https://github.com/StackExchange/StackExchange.Redis/pull/2288))
13+
- Adds: `IConnectionMultiplexer.ServerMaintenanceEvent` (was on `ConnectionMultiplexer` but not the interface) ([#2306 by NickCraver](https://github.com/StackExchange/StackExchange.Redis/pull/2306))
1314

1415

1516
## 2.6.80

src/StackExchange.Redis/Interfaces/IConnectionMultiplexer.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.IO;
44
using System.Net;
55
using System.Threading.Tasks;
6+
using StackExchange.Redis.Maintenance;
67
using StackExchange.Redis.Profiling;
78

89
namespace StackExchange.Redis
@@ -115,6 +116,11 @@ public interface IConnectionMultiplexer : IDisposable, IAsyncDisposable
115116
/// </summary>
116117
event EventHandler<EndPointEventArgs> ConfigurationChangedBroadcast;
117118

119+
/// <summary>
120+
/// Raised when server indicates a maintenance event is going to happen.
121+
/// </summary>
122+
event EventHandler<ServerMaintenanceEvent> ServerMaintenanceEvent;
123+
118124
/// <summary>
119125
/// Gets all endpoints defined on the multiplexer.
120126
/// </summary>

src/StackExchange.Redis/PublicAPI/PublicAPI.Shipped.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ StackExchange.Redis.IConnectionMultiplexer.PublishReconfigure(StackExchange.Redi
492492
StackExchange.Redis.IConnectionMultiplexer.PublishReconfigureAsync(StackExchange.Redis.CommandFlags flags = StackExchange.Redis.CommandFlags.None) -> System.Threading.Tasks.Task<long>!
493493
StackExchange.Redis.IConnectionMultiplexer.RegisterProfiler(System.Func<StackExchange.Redis.Profiling.ProfilingSession!>! profilingSessionProvider) -> void
494494
StackExchange.Redis.IConnectionMultiplexer.ResetStormLog() -> void
495+
StackExchange.Redis.IConnectionMultiplexer.ServerMaintenanceEvent -> System.EventHandler<StackExchange.Redis.Maintenance.ServerMaintenanceEvent!>!
495496
StackExchange.Redis.IConnectionMultiplexer.StormLogThreshold.get -> int
496497
StackExchange.Redis.IConnectionMultiplexer.StormLogThreshold.set -> void
497498
StackExchange.Redis.IConnectionMultiplexer.TimeoutMilliseconds.get -> int

tests/StackExchange.Redis.Tests/Helpers/SharedConnectionFixture.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Net;
66
using System.Threading;
77
using System.Threading.Tasks;
8+
using StackExchange.Redis.Maintenance;
89
using StackExchange.Redis.Profiling;
910
using Xunit;
1011

@@ -118,6 +119,12 @@ public event EventHandler<HashSlotMovedEventArgs> HashSlotMoved
118119
remove => _inner.HashSlotMoved -= value;
119120
}
120121

122+
public event EventHandler<ServerMaintenanceEvent> ServerMaintenanceEvent
123+
{
124+
add => _inner.ServerMaintenanceEvent += value;
125+
remove => _inner.ServerMaintenanceEvent -= value;
126+
}
127+
121128
public void Close(bool allowCommandsToComplete = true) => _inner.Close(allowCommandsToComplete);
122129

123130
public Task CloseAsync(bool allowCommandsToComplete = true) => _inner.CloseAsync(allowCommandsToComplete);

0 commit comments

Comments
 (0)