static RedisCluster() { // We get the static ctor to do the actual registration of the factory // method. Cluster.Register merely triggers the CLR to invoke this // ctor. ClusterFactory.RegisterProvider("redis", factory); }
/// <summary> /// Connect to a cluster /// </summary> /// <param name="providerName">Provider name is a unique name for the persistence layer /// type, for example: "redis"</param> /// <param name="config">Cluster config</param> public static ICluster connect( string providerName, ClusterConfig config) { var cluster = ClusterFactory.CreateCluster(providerName, config); cluster.Connect(); return(cluster); }
/// <summary> /// Connect to a cluster /// </summary> /// <param name="providerName">Provider name is a unique name for the persistence layer /// type, for example: "redis"</param> /// <param name="nodeName">Unique name for this process. It becomes the name of the root /// node and allows other services on the cluster to discover you and communicate with you. /// </param> /// <param name="connectionString">Provider defined connection string</param> /// <param name="catalogueName">>Provider defined catalogue name</param> public static ICluster connect( string providerName, ProcessName nodeName, string connectionString, string catalogueName, ProcessName role ) { var cluster = ClusterFactory.CreateCluster(providerName, config(nodeName, connectionString, catalogueName, role)); cluster.Connect(); return(cluster); }