Пример #1
0
        /// <summary>
        /// Create a process cluster
        /// </summary>
        /// <param name="providerName"></param>
        /// <param name="config"></param>
        /// <returns>ICluster</returns>
        public static ICluster CreateCluster(string providerName, ClusterConfig config)
        {
            if (providerName == null)
            {
                throw new ArgumentNullException(nameof(providerName));
            }
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            if (providers.ContainsKey(providerName))
            {
                return(providers[providerName](config));
            }
            else
            {
                throw new ArgumentException($"'{providerName}' isn't a registered provider", nameof(providerName));
            }
        }
Пример #2
0
 /// <summary>
 /// Ctor
 /// </summary>
 public RedisClusterImpl(ClusterConfig config)
 {
     this.config = config;
 }
Пример #3
0
 /// <summary>
 /// ICluster factory provider
 /// </summary>
 /// <param name="config">ClusterConfig</param>
 /// <returns>ICluster</returns>
 private static ICluster factory(ClusterConfig config)
 {
     return(new RedisClusterImpl(config));
 }