MetalamaAPI documentationPatterns APIMetalama.​Patterns.​Caching.​Backends.​RedisRedis­Caching­Backend­Configuration
Open sandboxFocus

RedisCachingBackendConfiguration Class

Configuration for Metalama.Patterns.Caching.Backends.Redis.RedisCachingBackend.

Inheritance
RedisCachingBackendConfiguration
Namespace: Metalama.Patterns.Caching.Backends.Redis
Assembly: Metalama.Patterns.Caching.Backends.Redis.dll
Syntax
public class RedisCachingBackendConfiguration : CachingBackendConfiguration

Constructors

Name Description
RedisCachingBackendConfiguration(RedisCachingBackendConfiguration)
RedisCachingBackendConfiguration(ConfigurationOptions, String)
RedisCachingBackendConfiguration(IConnectionMultiplexer, String)

Properties

Name Description
ConnectionTimeout

Gets the time that the Redis backend will wait for a Redis connection. (When you create a new Redis backend, if it doesn't connect to a Redis server in this timeout, a TimeoutException is thrown.)

CreateSerializer

Gets or sets a function that creates the serializer used to serialize objects into byte arrays (and conversely). The default value is null, which means that JsonCachingFormatter will be used.

Database

Gets or sets the index of the database to use. The default value is -1 (automatic selection).

DefaultExpiration

Gets or sets the default expiration time of cached items. All items that don't have an explicit expiration time are automatically expired according to the value of this property, unless they have the NotRemovable priority. The default value is 1 day.

EqualityContract
KeyPrefix

Gets or sets the prefix for the key of all Redis items created by the Metalama.Patterns.Caching.Backends.Redis.RedisCachingBackend. The default value is cache.

LogRedisConnection

Gets or sets a value indicating whether the logs of the StackExchange.Redis.ConnectionMultiplexer should be captured and redirected. The default value is false.

OwnsConnection

Gets or sets a value indicating whether determines whether the Metalama.Patterns.Caching.Backends.Redis.RedisCachingBackend should dispose the Redis connection when the Metalama.Patterns.Caching.Backends.Redis.RedisCachingBackend itself is disposed. The default value is false.

RunGarbageCollector

Gets or sets a value indicating whether the dependency garbage collector process should run while the caching back-end instance is alive. This property only makes sense when SupportsDependencies is set to true. The value of RunGarbageCollector is false by default. It is necessary to have at least one instance of the garbage collector active at any time. It is allowed but useless to have several concurrent instances of the garbage collector, but having a large number of them can hurt performance of the Redis server. The recommended approach to run the garbage collector is to deploy a separate application that only hosts this service. See CreateRedisCacheDependencyGarbageCollector(RedisCachingBackendConfiguration, IServiceProvider) for details.

SupportsDependencies

Gets or sets a value indicating whether the Metalama.Patterns.Caching.Backends.Redis.RedisCachingBackend should support dependencies. When this property is used, the Metalama.Patterns.Caching.Backends.Redis.DependenciesRedisCachingBackend class is used instead of Metalama.Patterns.Caching.Backends.Redis.RedisCachingBackend. Note that when dependencies are enabled, at least one instance of the Redis garbage collection must run. See RunGarbageCollector for details.

TransactionMaxRetries

Gets or sets the number of times Redis transactions are retried when they fail due to a data conflict, before an exception is raised. The default value is 5.

Methods

Name Description
<Clone>$()
Equals(CachingBackendConfiguration)
Equals(RedisCachingBackendConfiguration)
Equals(Object)
GetHashCode()
PrintMembers(StringBuilder)
ToString()

Operators

Name Description
Equality(RedisCachingBackendConfiguration, RedisCachingBackendConfiguration)
Inequality(RedisCachingBackendConfiguration, RedisCachingBackendConfiguration)