C# Class BB.Caching.Redis.ConnectionGroup

A group of connections for Redis. Used to group a master-slave setup so that we can treat the master as the single write connection (/ read connection) and the slave(s) as the read connection(s).
Datei anzeigen Open project: JesseBuesking/BB.Caching Class Usage Examples

Public Methods

Method Description
AddReadConnection ( string connection, bool establishConnection = true ) : void

Adds a read connection.

AddWriteConnection ( string connection, bool establishConnection = true ) : void

Adds a write connection.

ConnectionGroup ( string name, bool analytics = false ) : System

Initializes a new instance of the ConnectionGroup class.

GetReadMultiplexer ( ) : StackExchange.Redis.ConnectionMultiplexer

Retrieves a connection from the read pool on a round-robin basis.

GetWriteMultiplexer ( ) : StackExchange.Redis.ConnectionMultiplexer

Retrieves the available write connections.

ToString ( ) : string

Returns a string that represents the current object.

Private Methods

Method Description
UpdateReadPool ( ) : void

Updates the read pool with connections.

Method Details

AddReadConnection() public method

Adds a read connection.
public AddReadConnection ( string connection, bool establishConnection = true ) : void
connection string /// The connection. ///
establishConnection bool /// Talks with the redis instance defined in the connection string to establish a connection. ///
return void

AddWriteConnection() public method

Adds a write connection.
public AddWriteConnection ( string connection, bool establishConnection = true ) : void
connection string /// The connection. ///
establishConnection bool /// Talks with the redis instance defined in the connection string to establish a connection. ///
return void

ConnectionGroup() public method

Initializes a new instance of the ConnectionGroup class.
public ConnectionGroup ( string name, bool analytics = false ) : System
name string /// The name. ///
analytics bool /// True if this connection group is used for bitwise analytics. ///
return System

GetReadMultiplexer() public method

Retrieves a connection from the read pool on a round-robin basis.
public GetReadMultiplexer ( ) : StackExchange.Redis.ConnectionMultiplexer
return StackExchange.Redis.ConnectionMultiplexer

GetWriteMultiplexer() public method

Retrieves the available write connections.
public GetWriteMultiplexer ( ) : StackExchange.Redis.ConnectionMultiplexer
return StackExchange.Redis.ConnectionMultiplexer

ToString() public method

Returns a string that represents the current object.
public ToString ( ) : string
return string