Interface IConnectionMultiplexer
- Namespace
- StackExchange.Redis
- Assembly
- StackExchange.Redis.StrongName.dll
Represents the abstract multiplexer API
public interface IConnectionMultiplexer
Properties
ClientName
Gets the client-name that will be used on all new connections
string ClientName { get; }
Property Value
Configuration
Gets the configuration of the connection
string Configuration { get; }
Property Value
IncludeDetailInExceptions
Should exceptions include identifiable details? (key names, additional .Data annotations)
bool IncludeDetailInExceptions { get; set; }
Property Value
IsConnected
Indicates whether any servers are connected
bool IsConnected { get; }
Property Value
OperationCount
The number of operations that have been performed on all connections
long OperationCount { get; }
Property Value
PreserveAsyncOrder
Gets or sets whether asynchronous operations should be invoked in a way that guarantees their original delivery order
bool PreserveAsyncOrder { get; set; }
Property Value
StormLogThreshold
Limit at which to start recording unusual busy patterns (only one log will be retained at a time; set to a negative value to disable this feature)
int StormLogThreshold { get; set; }
Property Value
TimeoutMilliseconds
Gets the timeout associated with the connections
int TimeoutMilliseconds { get; }
Property Value
Methods
BeginProfiling(object)
Begins profiling for the given context.
If the same context object is returned by the registered IProfiler, the IProfiledCommands will be associated with each other.
Call FinishProfiling with the same context to get the assocated commands.
Note that forContext cannot be a WeakReference or a WeakReference<T>
void BeginProfiling(object forContext)
Parameters
forContext
object
Close(bool)
Close all connections and release all resources associated with this object
void Close(bool allowCommandsToComplete = true)
Parameters
allowCommandsToComplete
bool
CloseAsync(bool)
Close all connections and release all resources associated with this object
Task CloseAsync(bool allowCommandsToComplete = true)
Parameters
allowCommandsToComplete
bool
Returns
Configure(TextWriter)
Reconfigure the current connections based on the existing configuration
bool Configure(TextWriter log = null)
Parameters
log
TextWriter
Returns
ConfigureAsync(TextWriter)
Reconfigure the current connections based on the existing configuration
Task<bool> ConfigureAsync(TextWriter log = null)
Parameters
log
TextWriter
Returns
Dispose()
Release all resources associated with this object
void Dispose()
FinishProfiling(object, bool)
Stops profiling for the given context, returns all IProfiledCommands associated.
By default this may do a sweep for dead profiling contexts, you can disable this by passing "allowCleanupSweep: false".
ProfiledCommandEnumerable FinishProfiling(object forContext, bool allowCleanupSweep = true)
Parameters
Returns
GetCounters()
Get summary statistics associates with this server
ServerCounters GetCounters()
Returns
GetDatabase(int, object)
Obtain an interactive connection to a database inside redis
IDatabase GetDatabase(int db = -1, object asyncState = null)
Parameters
Returns
GetEndPoints(bool)
Gets all endpoints defined on the server
EndPoint[] GetEndPoints(bool configuredOnly = false)
Parameters
configuredOnly
bool
Returns
- EndPoint[]
GetServer(EndPoint, object)
Obtain a configuration API for an individual server
IServer GetServer(EndPoint endpoint, object asyncState = null)
Parameters
Returns
GetServer(IPAddress, int)
Obtain a configuration API for an individual server
IServer GetServer(IPAddress host, int port)
Parameters
Returns
GetServer(string, int, object)
Obtain a configuration API for an individual server
IServer GetServer(string host, int port, object asyncState = null)
Parameters
Returns
GetServer(string, object)
Obtain a configuration API for an individual server
IServer GetServer(string hostAndPort, object asyncState = null)
Parameters
Returns
GetStatus()
Provides a text overview of the status of all connections
string GetStatus()
Returns
GetStatus(TextWriter)
Provides a text overview of the status of all connections
void GetStatus(TextWriter log)
Parameters
log
TextWriter
GetStormLog()
Obtains the log of unusual busy patterns
string GetStormLog()
Returns
GetSubscriber(object)
Obtain a pub/sub subscriber connection to the specified server
ISubscriber GetSubscriber(object asyncState = null)
Parameters
asyncState
object
Returns
HashSlot(RedisKey)
Compute the hash-slot of a specified key
int HashSlot(RedisKey key)
Parameters
key
RedisKey
Returns
PublishReconfigure(CommandFlags)
Request all compatible clients to reconfigure or reconnect
long PublishReconfigure(CommandFlags flags = CommandFlags.None)
Parameters
flags
CommandFlags
Returns
- long
The number of instances known to have received the message (however, the actual number can be higher; returns -1 if the operation is pending)
PublishReconfigureAsync(CommandFlags)
Request all compatible clients to reconfigure or reconnect
Task<long> PublishReconfigureAsync(CommandFlags flags = CommandFlags.None)
Parameters
flags
CommandFlags
Returns
- Task<long>
The number of instances known to have received the message (however, the actual number can be higher)
RegisterProfiler(IProfiler)
Sets an IProfiler instance for this ConnectionMultiplexer.
An IProfiler instances is used to determine which context to associate an IProfiledCommand with. See BeginProfiling(object) and FinishProfiling(object) for more details.
void RegisterProfiler(IProfiler profiler)
Parameters
profiler
IProfiler
ResetStormLog()
Resets the log of unusual busy patterns
void ResetStormLog()
ToString()
See Object.ToString()
string ToString()
Returns
Wait(Task)
Wait for a given asynchronous operation to complete (or timeout)
void Wait(Task task)
Parameters
task
Task
WaitAll(params Task[])
Wait for the given asynchronous operations to complete (or timeout)
void WaitAll(params Task[] tasks)
Parameters
tasks
Task[]
Wait<T>(Task<T>)
Wait for a given asynchronous operation to complete (or timeout)
T Wait<T>(Task<T> task)
Parameters
task
Task<T>
Returns
- T
Type Parameters
T
Events
ConfigurationChanged
Raised when configuration changes are detected
event EventHandler<EndPointEventArgs> ConfigurationChanged
Event Type
ConfigurationChangedBroadcast
Raised when nodes are explicitly requested to reconfigure via broadcast; this usually means master/slave changes
event EventHandler<EndPointEventArgs> ConfigurationChangedBroadcast
Event Type
ConnectionFailed
Raised whenever a physical connection fails
event EventHandler<ConnectionFailedEventArgs> ConnectionFailed
Event Type
ConnectionRestored
Raised whenever a physical connection is established
event EventHandler<ConnectionFailedEventArgs> ConnectionRestored
Event Type
ErrorMessage
A server replied with an error message;
event EventHandler<RedisErrorEventArgs> ErrorMessage
Event Type
HashSlotMoved
Raised when a hash-slot has been relocated
event EventHandler<HashSlotMovedEventArgs> HashSlotMoved
Event Type
InternalError
Raised whenever an internal error occurs (this is primarily for debugging)
event EventHandler<InternalErrorEventArgs> InternalError