Class RedisStorage
Inheritance
Namespace: Telerik.Reporting.Cache.StackExchangeRedis
Assembly: Telerik.Reporting.Cache.StackExchangeRedis.dll
Syntax
public class RedisStorage : IStorage
Remarks
RedisStorage connects to Redis server using the StackExchange.Redis () client. Redis server provides built-in application locks mechanism which RedisStorage implementation utilizes. This makes it suitable for both single and multiple service instance deployment.
Constructors
RedisStorage(ConnectionMultiplexer)
Initializes a new instance of the RedisStorage class.
Declaration
public RedisStorage(ConnectionMultiplexer connection)
Parameters
StackExchange.Redis.ConnectionMultiplexer
connection
An object hiding the Redis connection details. Should be reused (static/ shared) for each request. |
RedisStorage(ConnectionMultiplexer, String)
Initializes a new instance of the RedisStorage class.
Declaration
public RedisStorage(ConnectionMultiplexer connection, string keysPrefix)
Parameters
RedisStorage(ConnectionMultiplexer, String, Int32)
Initializes a new instance of the RedisStorage class.
Declaration
[Obsolete("This constructor is now obsolete. Instantiate a ConnectionMultiplexer using a ConfigurationOptions with defaultDatabase key set.")]
public RedisStorage(ConnectionMultiplexer connection, string keysPrefix, int databaseNumber)
Parameters
Properties
LockTimeout
Gets or sets the acquired lock timeout in seconds. When expired, lock is released. Default timeout is 3 seconds.
Declaration
public int LockTimeout { get; set; }
Property Value
System.Int32
|
Methods
AcquireLock(String)
Acquires a lock on a named resource.
Declaration
public IDisposable AcquireLock(string key)
Parameters
System.String
key
|
Returns
System.IDisposable
|
Implements
See Also
AcquireReadLock(String)
Declaration
public IDisposable AcquireReadLock(string key)
Parameters
System.String
key
|
Returns
System.IDisposable
|
Implements
AddInSet(String, String)
Adds a single string value to a set of values denoted from the given key.
Declaration
public void AddInSet(string key, string value)
Parameters
System.String
key
|
System.String
value
|
Implements
See Also
Delete(String)
Deletes a key with its value (string or byte array) from the storage.
Declaration
public void Delete(string key)
Parameters
System.String
key
|
Implements
See Also
DeleteInSet(String, String)
Deletes a single string value from a set of values denoted from the given key.
Declaration
public bool DeleteInSet(string key, string value)
Parameters
System.String
key
|
System.String
value
|
Returns
System.Boolean
|
Implements
See Also
DeleteSet(String)
Deletes a key with its values from the storage.
Declaration
public void DeleteSet(string key)
Parameters
System.String
key
|
Implements
Exists(String)
Retrieves a value indicating if a single value (string or byte array) exists in the storage.
Declaration
public bool Exists(string key)
Parameters
System.String
key
|
Returns
System.Boolean
|
Implements
See Also
ExistsInSet(String, String)
Retrieves a value indicating if a set of values exists in the storage.
Declaration
public bool ExistsInSet(string key, string value)
Parameters
System.String
key
|
System.String
value
|
Returns
System.Boolean
|
Implements
See Also
GetAllMembersInSet(String)
Retrieves all members in a set of string values.
Declaration
public IEnumerable<string> GetAllMembersInSet(string key)
Parameters
System.String
key
|
Returns
System.Collections.Generic.IEnumerable<System.String>
|
Implements
See Also
GetBytes(String)
Retrieves a byte array value stored under particular key.
Declaration
public byte[] GetBytes(string key)
Parameters
System.String
key
|
Returns
System.Byte[]
|
Implements
See Also
GetCountInSet(String)
Retrieves the count of the values in a set value stored in the storage.
Declaration
public long GetCountInSet(string key)
Parameters
System.String
key
|
Returns
System.Int64
|
Implements
See Also
GetString(String)
Retrieves a string value stored under particular key.
Declaration
public string GetString(string key)
Parameters
System.String
key
|
Returns
System.String
|
Implements
See Also
SetBytes(String, Byte[])
Stores a byte array value under particular key.
Declaration
public void SetBytes(string key, byte[] value)
Parameters
System.String
key
|
System.Byte[]
value
|
Implements
See Also
SetString(String, String)
Stores a string value under particular key.
Declaration
public void SetString(string key, string value)
Parameters
System.String
key
|
System.String
value
|