Show / Hide Table of Contents

Class CacheOptions

Inheritance
System.Object
CacheOptions
CacheOptions<T>
EvalCacheOptions
Namespace: AzureFromTheTrenches.Commanding.Cache
Assembly: AzureFromTheTrenches.Commanding.Cache.dll
Syntax
public class CacheOptions : object

Constructors

| Improve this Doc View Source

CacheOptions(Func<DateTime>, Nullable<Int32>)

Declaration
protected CacheOptions(Func<DateTime> expiresAtUtcFunc, int? maxConcurrentExecutions = null)
Parameters
Type Name Description
Func<DateTime> expiresAtUtcFunc
System.Nullable<System.Int32> maxConcurrentExecutions
| Improve this Doc View Source

CacheOptions(Func<TimeSpan>, Nullable<Int32>)

Declaration
protected CacheOptions(Func<TimeSpan> lifeTimeFunc, int? maxConcurrentExecutions = null)
Parameters
Type Name Description
Func<TimeSpan> lifeTimeFunc
System.Nullable<System.Int32> maxConcurrentExecutions
| Improve this Doc View Source

CacheOptions(Type, DateTime, Nullable<Int32>)

Declaration
public CacheOptions(Type commandType, DateTime expiresAtUtc, int? maxConcurrentExecutions = null)
Parameters
Type Name Description
Type commandType
DateTime expiresAtUtc
System.Nullable<System.Int32> maxConcurrentExecutions
| Improve this Doc View Source

CacheOptions(Type, Func<DateTime>, Nullable<Int32>)

Declaration
public CacheOptions(Type commandType, Func<DateTime> expiresAtUtcFunc, int? maxConcurrentExecutions = null)
Parameters
Type Name Description
Type commandType
Func<DateTime> expiresAtUtcFunc
System.Nullable<System.Int32> maxConcurrentExecutions
| Improve this Doc View Source

CacheOptions(Type, Func<TimeSpan>, Nullable<Int32>)

Declaration
public CacheOptions(Type commandType, Func<TimeSpan> lifeTimeFunc, int? maxConcurrentExecutions = null)
Parameters
Type Name Description
Type commandType
Func<TimeSpan> lifeTimeFunc
System.Nullable<System.Int32> maxConcurrentExecutions
| Improve this Doc View Source

CacheOptions(Type, TimeSpan, Nullable<Int32>)

Declaration
public CacheOptions(Type commandType, TimeSpan lifeTime, int? maxConcurrentExecutions = null)
Parameters
Type Name Description
Type commandType
TimeSpan lifeTime
System.Nullable<System.Int32> maxConcurrentExecutions

Properties

| Improve this Doc View Source

CommandType

Declaration
public Type CommandType { get; }
Property Value
Type Description
Type
| Improve this Doc View Source

ExpiresAtUtc

Declaration
public Func<DateTime> ExpiresAtUtc { get; }
Property Value
Type Description
Func<DateTime>
| Improve this Doc View Source

LifeTime

Declaration
public Func<TimeSpan> LifeTime { get; }
Property Value
Type Description
Func<TimeSpan>
| Improve this Doc View Source

MaxConcurrentExecutions

If set this throttles the number of concurrent executions that can occur of the underlying command handler when the cache misses. This can be useful when the underlying request is expensive and hitting it with multiple requests simultaneously could cause failures. This is mostly intended for scenarios with high levels of requests / transactions. Note that the implementation for this uses a double lock approach with a semaphore and so anything that finds itself blocked due to the throttle should find the result in the cache. Should further be noted that this lock is obviously within the process and not shared across servers.

Declaration
public int? MaxConcurrentExecutions { get; }
Property Value
Type Description
System.Nullable<System.Int32>
  • Improve this Doc
  • View Source
  • 0 Comments
Back to top Copyright © 2018 James Randall