Commit 8aa456fe authored by Nick Craver's avatar Nick Craver

Cleanup: IConnectionMultiplexer

parent 8ff7c969
...@@ -69,6 +69,7 @@ public interface IConnectionMultiplexer ...@@ -69,6 +69,7 @@ public interface IConnectionMultiplexer
/// IProfiledCommand with. See BeginProfiling(object) and FinishProfiling(object) /// IProfiledCommand with. See BeginProfiling(object) and FinishProfiling(object)
/// for more details. /// for more details.
/// </summary> /// </summary>
/// <param name="profiler">The profiler to register.</param>
void RegisterProfiler(IProfiler profiler); void RegisterProfiler(IProfiler profiler);
/// <summary> /// <summary>
...@@ -81,6 +82,7 @@ public interface IConnectionMultiplexer ...@@ -81,6 +82,7 @@ public interface IConnectionMultiplexer
/// ///
/// Note that forContext cannot be a WeakReference or a WeakReference&lt;T&gt; /// Note that forContext cannot be a WeakReference or a WeakReference&lt;T&gt;
/// </summary> /// </summary>
/// <param name="forContext">The context to begin profiling for.</param>
void BeginProfiling(object forContext); void BeginProfiling(object forContext);
/// <summary> /// <summary>
...@@ -88,6 +90,8 @@ public interface IConnectionMultiplexer ...@@ -88,6 +90,8 @@ public interface IConnectionMultiplexer
/// ///
/// By default this may do a sweep for dead profiling contexts, you can disable this by passing "allowCleanupSweep: false". /// By default this may do a sweep for dead profiling contexts, you can disable this by passing "allowCleanupSweep: false".
/// </summary> /// </summary>
/// <param name="forContext">The context to finish profiling for.</param>
/// <param name="allowCleanupSweep">Whether to allow a cleanup sweep of dead profiling contexts.</param>
ProfiledCommandEnumerable FinishProfiling(object forContext, bool allowCleanupSweep = true); ProfiledCommandEnumerable FinishProfiling(object forContext, bool allowCleanupSweep = true);
/// <summary> /// <summary>
...@@ -129,22 +133,26 @@ public interface IConnectionMultiplexer ...@@ -129,22 +133,26 @@ public interface IConnectionMultiplexer
/// <summary> /// <summary>
/// Gets all endpoints defined on the server /// Gets all endpoints defined on the server
/// </summary> /// </summary>
/// <returns></returns> /// <param name="configuredOnly">Whether to return only the explicitly configured endpoints.</param>
EndPoint[] GetEndPoints(bool configuredOnly = false); EndPoint[] GetEndPoints(bool configuredOnly = false);
/// <summary> /// <summary>
/// Wait for a given asynchronous operation to complete (or timeout) /// Wait for a given asynchronous operation to complete (or timeout)
/// </summary> /// </summary>
/// <param name="task">The task to wait on.</param>
void Wait(Task task); void Wait(Task task);
/// <summary> /// <summary>
/// Wait for a given asynchronous operation to complete (or timeout) /// Wait for a given asynchronous operation to complete (or timeout)
/// </summary> /// </summary>
/// <typeparam name="T">The type in <paramref name="task"/>.</typeparam>
/// <param name="task">The task to wait on.</param>
T Wait<T>(Task<T> task); T Wait<T>(Task<T> task);
/// <summary> /// <summary>
/// Wait for the given asynchronous operations to complete (or timeout) /// Wait for the given asynchronous operations to complete (or timeout)
/// </summary> /// </summary>
/// <param name="tasks">The tasks to wait on.</param>
void WaitAll(params Task[] tasks); void WaitAll(params Task[] tasks);
/// <summary> /// <summary>
...@@ -155,46 +163,61 @@ public interface IConnectionMultiplexer ...@@ -155,46 +163,61 @@ public interface IConnectionMultiplexer
/// <summary> /// <summary>
/// Compute the hash-slot of a specified key /// Compute the hash-slot of a specified key
/// </summary> /// </summary>
/// <param name="key">The key to get a slot ID for.</param>
int HashSlot(RedisKey key); int HashSlot(RedisKey key);
/// <summary> /// <summary>
/// Obtain a pub/sub subscriber connection to the specified server /// Obtain a pub/sub subscriber connection to the specified server
/// </summary> /// </summary>
/// <param name="asyncState">The async state to pass to the created <see cref="ISubscriber"/>.</param>
ISubscriber GetSubscriber(object asyncState = null); ISubscriber GetSubscriber(object asyncState = null);
/// <summary> /// <summary>
/// Obtain an interactive connection to a database inside redis /// Obtain an interactive connection to a database inside redis
/// </summary> /// </summary>
/// <param name="db">The database ID to get.</param>
/// <param name="asyncState">The async state to pass to the created <see cref="IDatabase"/>.</param>
IDatabase GetDatabase(int db = -1, object asyncState = null); IDatabase GetDatabase(int db = -1, object asyncState = null);
/// <summary> /// <summary>
/// Obtain a configuration API for an individual server /// Obtain a configuration API for an individual server
/// </summary> /// </summary>
/// <param name="host">The host to get a server for.</param>
/// <param name="port">The specific port for <paramref name="host"/> to get a server for.</param>
/// <param name="asyncState">The async state to pass to the created <see cref="IServer"/>.</param>
IServer GetServer(string host, int port, object asyncState = null); IServer GetServer(string host, int port, object asyncState = null);
/// <summary> /// <summary>
/// Obtain a configuration API for an individual server /// Obtain a configuration API for an individual server
/// </summary> /// </summary>
/// <param name="hostAndPort">The "host:port" string to get a server for.</param>
/// <param name="asyncState">The async state to pass to the created <see cref="IServer"/>.</param>
IServer GetServer(string hostAndPort, object asyncState = null); IServer GetServer(string hostAndPort, object asyncState = null);
/// <summary> /// <summary>
/// Obtain a configuration API for an individual server /// Obtain a configuration API for an individual server
/// </summary> /// </summary>
/// <param name="host">The host to get a server for.</param>
/// <param name="port">The specific port for <paramref name="host"/> to get a server for.</param>
IServer GetServer(IPAddress host, int port); IServer GetServer(IPAddress host, int port);
/// <summary> /// <summary>
/// Obtain a configuration API for an individual server /// Obtain a configuration API for an individual server
/// </summary> /// </summary>
/// <param name="endpoint">The endpoint to get a server for.</param>
/// <param name="asyncState">The async state to pass to the created <see cref="IServer"/>.</param>
IServer GetServer(EndPoint endpoint, object asyncState = null); IServer GetServer(EndPoint endpoint, object asyncState = null);
/// <summary> /// <summary>
/// Reconfigure the current connections based on the existing configuration /// Reconfigure the current connections based on the existing configuration
/// </summary> /// </summary>
/// <param name="log">The log to write output to.</param>
Task<bool> ConfigureAsync(TextWriter log = null); Task<bool> ConfigureAsync(TextWriter log = null);
/// <summary> /// <summary>
/// Reconfigure the current connections based on the existing configuration /// Reconfigure the current connections based on the existing configuration
/// </summary> /// </summary>
/// <param name="log">The log to write output to.</param>
bool Configure(TextWriter log = null); bool Configure(TextWriter log = null);
/// <summary> /// <summary>
...@@ -205,6 +228,7 @@ public interface IConnectionMultiplexer ...@@ -205,6 +228,7 @@ public interface IConnectionMultiplexer
/// <summary> /// <summary>
/// Provides a text overview of the status of all connections /// Provides a text overview of the status of all connections
/// </summary> /// </summary>
/// <param name="log">The log to write output to.</param>
void GetStatus(TextWriter log); void GetStatus(TextWriter log);
/// <summary> /// <summary>
...@@ -215,11 +239,13 @@ public interface IConnectionMultiplexer ...@@ -215,11 +239,13 @@ public interface IConnectionMultiplexer
/// <summary> /// <summary>
/// Close all connections and release all resources associated with this object /// Close all connections and release all resources associated with this object
/// </summary> /// </summary>
/// <param name="allowCommandsToComplete">Whether to allow in-queue commadns to complete first.</param>
void Close(bool allowCommandsToComplete = true); void Close(bool allowCommandsToComplete = true);
/// <summary> /// <summary>
/// Close all connections and release all resources associated with this object /// Close all connections and release all resources associated with this object
/// </summary> /// </summary>
/// <param name="allowCommandsToComplete">Whether to allow in-queue commadns to complete first.</param>
Task CloseAsync(bool allowCommandsToComplete = true); Task CloseAsync(bool allowCommandsToComplete = true);
/// <summary> /// <summary>
...@@ -240,12 +266,14 @@ public interface IConnectionMultiplexer ...@@ -240,12 +266,14 @@ public interface IConnectionMultiplexer
/// <summary> /// <summary>
/// Request all compatible clients to reconfigure or reconnect /// Request all compatible clients to reconfigure or reconnect
/// </summary> /// </summary>
/// <param name="flags">The command flags to use.</param>
/// <returns>The number of instances known to have received the message (however, the actual number can be higher; returns -1 if the operation is pending)</returns> /// <returns>The number of instances known to have received the message (however, the actual number can be higher; returns -1 if the operation is pending)</returns>
long PublishReconfigure(CommandFlags flags = CommandFlags.None); long PublishReconfigure(CommandFlags flags = CommandFlags.None);
/// <summary> /// <summary>
/// Request all compatible clients to reconfigure or reconnect /// Request all compatible clients to reconfigure or reconnect
/// </summary> /// </summary>
/// <param name="flags">The command flags to use.</param>
/// <returns>The number of instances known to have received the message (however, the actual number can be higher)</returns> /// <returns>The number of instances known to have received the message (however, the actual number can be higher)</returns>
Task<long> PublishReconfigureAsync(CommandFlags flags = CommandFlags.None); Task<long> PublishReconfigureAsync(CommandFlags flags = CommandFlags.None);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment