コード例 #1
0
        internal static void Initialize()
        {
            #region Initialize Redis Connections

            switch (Environment.Current.ToLower())
            {
                #region Production

            case "production":
                _redisConnections = new RedisConnections(

                    //Global (C1 Dedicated (or C2 Dedicated ???)
                    //IMPORTANT SETTINGS on Azure: Allow access only via SSL = OFF !!!!!
                    "[Config_Name].redis.cache.windows.net",
                    "[Config_Key]"

                    );
                break;

                #endregion


                #region Stage

            case "stage":
                _redisConnections = new RedisConnections(

                    //Global (C0 Shared)
                    //IMPORTANT SETTINGS on Azure: Allow access only via SSL = OFF !!!!!
                    "[Config_Name]-Stage.redis.cache.windows.net",
                    "[Config_Key]"

                    );
                break;


                #endregion


                #region Local/Debug

            case "debug":
                _redisConnections = new RedisConnections(

                    //Global
                    //IMPORTANT SETTINGS on Azure: Allow access only via SSL = OFF !!!!!
                    "[Config_Name]-Debug.redis.cache.windows.net",
                    "[Config_Key]"

                    );
                break;


            case "local":
                _redisConnections = new RedisConnections(

                    //Global (C1 Dedicated (or C2 Dedicated ???)
                    //IMPORTANT SETTINGS on Azure: Allow access only via SSL = OFF !!!!!
                    "[Config_Name]-Local.redis.cache.windows.net",
                    "[Config_Key]"

                    );
                break;

                #endregion

            default:
                _redisConnections = null;
                break;
            }

            #endregion


            #region Initialize Multiplexers

            //Because the  ConnectionMultiplexer  does a lot, it is designed to be shared and reused between callers.
            //You should not create a  ConnectionMultiplexer  per operation. It is fully thread-safe and ready for this usage.
            //In all the subsequent examples it will be assumed that you have a  ConnectionMultiplexer  instance stored away for re-use.

            _redisConnectionMultiplexers = new RedisConnectionMultiplexers(

                ConnectionMultiplexer.Connect(RedisConnections.RedisConfiguration)
                );


            #endregion
        }
コード例 #2
0
ファイル: RocketRedisOptions.cs プロジェクト: AiwinsFx/Rocket
 public RocketRedisOptions()
 {
     Connections = new RedisConnections();
 }