/// <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)); } }
/// <summary> /// Ctor /// </summary> public RedisClusterImpl(ClusterConfig config) { this.config = config; }
/// <summary> /// ICluster factory provider /// </summary> /// <param name="config">ClusterConfig</param> /// <returns>ICluster</returns> private static ICluster factory(ClusterConfig config) { return(new RedisClusterImpl(config)); }