Esempio n. 1
0
 public SelfResolvingClusterOptions(IServiceProvider services, IMemcachedClusterOptions fallback)
 {
     Allocator = services.GetService <MemoryPool <byte> >() ?? fallback.Allocator;
     Locator   = services.GetService <INodeLocator>() ?? fallback.Locator;
     ReconnectPolicyFactory = services.GetService <IReconnectPolicyFactory>() ?? fallback.ReconnectPolicyFactory;
     FailurePolicyFactory   = services.GetService <IFailurePolicyFactory>() ?? fallback.FailurePolicyFactory;
     SocketFactory          = services.GetService <ISocketFactory>() ?? fallback.SocketFactory;
 }
Esempio n. 2
0
        public static IMemcachedConfigurationBuilder SetOptions(this IMemcachedConfigurationBuilder builder, IMemcachedClusterOptions options)
        {
            builder.Services.AddSingleton(options);

            return(builder);
        }