src/Orleans.Runtime/GrainDirectory/GrainDirectoryCacheFactory.cs
/// <summary>
/// Creates a new grain directory cache instance.
/// </summary>
/// <param name="services">The services.</param>
/// <param name="options">The options.</param>
/// <returns>The newly created <see cref="IGrainDirectoryCache"/> instance.</returns>
Creates a new grain directory cache instance.
Creates a new grain directory cache instance .
public static IGrainDirectoryCache CreateGrainDirectoryCache(IServiceProvider services, GrainDirectoryOptions options)
        {
            if (options.CacheSize <= 0)
                return new NullGrainDirectoryCache();
            switch (options.CachingStrategy)
            {
                case GrainDirectoryOptions.CachingStrategyType.None:
                    return new NullGrainDirectoryCache();
                case GrainDirectoryOptions.CachingStrategyType.LRU:
                    return new LRUBasedGrainDirectoryCache(options.CacheSize, options.MaximumCacheTTL);
                case GrainDirectoryOptions.CachingStrategyType.Adaptive:
                    return new AdaptiveGrainDirectoryCache(options.InitialCacheTTL, options.MaximumCacheTTL, options.CacheTTLExtensionFactor, options.CacheSize);
                case GrainDirectoryOptions.CachingStrategyType.Custom:
                default:
                    return services.GetRequiredService<IGrainDirectoryCache>();
            }
        }
public static IGrainDirectoryCache CreateGrainDirectoryCache ( IServiceProvider services , GrainDirectoryOptions options ) { if ( options . CacheSize <= 0 ) return new NullGrainDirectoryCache ( ) ; switch ( options . CachingStrategy ) { case GrainDirectoryOptions . CachingStrategyType . None : return new NullGrainDirectoryCache ( ) ; case GrainDirectoryOptions . CachingStrategyType . LRU : return new LRUBasedGrainDirectoryCache ( options . CacheSize , options . MaximumCacheTTL ) ; case GrainDirectoryOptions . CachingStrategyType . Adaptive : return new AdaptiveGrainDirectoryCache ( options . InitialCacheTTL , options . MaximumCacheTTL , options . CacheTTLExtensionFactor , options . CacheSize ) ; case GrainDirectoryOptions . CachingStrategyType . Custom : default : return services . GetRequiredService < IGrainDirectoryCache > ( ) ; } }
Creates a new grain directory cache instance.
Creates a new grain directory cache instance .
The newly created  instance.
The newly created instance .
services
IServiceProvider
None
options
GrainDirectoryOptions
None