ClassRedisStorage
Definition
Namespace:Telerik.Reporting.Cache.StackExchangeRedis
Assembly:Telerik.Reporting.Cache.StackExchangeRedis.dll
Syntax:
public class RedisStorage : IStorage
Inheritance: objectRedisStorage
Implements:
Constructors
RedisStorage(ConnectionMultiplexer)
Initializes a new instance of the RedisStorage class.
RedisStorage(ConnectionMultiplexer, string)
Initializes a new instance of the RedisStorage class.
Declaration
public RedisStorage(ConnectionMultiplexer connection, string keysPrefix)
Parameters
connection
ConnectionMultiplexer
An object hiding the Redis connection details. Should be reused (static/ shared) for each request.
keysPrefix
string
String prefix that should be applied on each key stored in the Redis database. This allows shared usage of one Redis database.
RedisStorage(ConnectionMultiplexer, string, int)
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
connection
ConnectionMultiplexer
An object hiding the Redis connection details. Should be reused (static/ shared) for each request.
keysPrefix
string
String prefix that should be applied on each key stored in the Redis database. This allows shared usage of one Redis database.
databaseNumber
int
Determines the number of the database that should be used.
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
int
Methods
AcquireLock(string)
Acquires a lock on a named resource.
Declaration
public IDisposable AcquireLock(string key)
Parameters
key
string
Returns
IDisposable
Implements
AcquireReadLock(string)
Acquires a lock on a named resource for reading, using less-restrictive locking mechanism.
Declaration
public IDisposable AcquireReadLock(string key)
Parameters
key
string
Returns
IDisposable
Implements
Remarks
Acquires a lock on a named resource and returns a disposable lock object. When the lock object owner disposes it, the lock is released.
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
key
string
value
string
Implements
Delete(string)
Deletes a key with its value (string or byte array) from the storage.
Declaration
public void Delete(string key)
Parameters
key
string
Implements
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
key
string
value
string
Returns
bool
Implements
DeleteSet(string)
Deletes a key with its values from the storage.
Declaration
public void DeleteSet(string key)
Parameters
key
string
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
key
string
Returns
bool
Implements
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
key
string
value
string
Returns
bool
Implements
GetAllMembersInSet(string)
Retrieves all members in a set of string values.
Declaration
public IEnumerable<string> GetAllMembersInSet(string key)
Parameters
key
string
Returns
IEnumerable<string>
Implements
GetBytes(string)
Retrieves a byte array value stored under particular key.
Declaration
public byte[] GetBytes(string key)
Parameters
key
string
Returns
byte[]
Implements
GetCountInSet(string)
Retrieves the count of the values in a set value stored in the storage.
Declaration
public long GetCountInSet(string key)
Parameters
key
string
Returns
long
Implements
GetString(string)
Retrieves a string value stored under particular key.
Declaration
public string GetString(string key)
Parameters
key
string
Returns
string
Implements
SetBytes(string, byte[])
Stores a byte array value under particular key.
Declaration
public void SetBytes(string key, byte[] value)
Parameters
key
string
value
byte[]
Implements
SetString(string, string)
Stores a string value under particular key.
Declaration
public void SetString(string key, string value)
Parameters
key
string
value
string
Implements