コード例 #1
0
 public RedisMembershipTable(IOptions <RedisClusteringOptions> redisOptions, IOptions <ClusterOptions> clusterOptions)
 {
     _redisOptions           = redisOptions.Value;
     _clusterOptions         = clusterOptions.Value;
     _clusterKey             = $"{_clusterOptions.ServiceId}/{_clusterOptions.ClusterId}";
     _jsonSerializerSettings = JsonSettings.JsonSerializerSettings;
 }
コード例 #2
0
        public RedisGatewayListProvider(IOptions <RedisClusteringOptions> membershipTableOptions,
                                        IOptions <ClusterOptions> clusterOptions, ILog logger = null)
        {
            this.logger = logger;
            options     = membershipTableOptions.Value;
            ConfigurationOptions configOptions = GetRedisConfiguration();

            clusterId  = clusterOptions.Value.ClusterId;
            connection = ConnectionMultiplexer.Connect(configOptions);
            database   = connection.GetDatabase();
            serializer = new BinarySerializer();
        }
コード例 #3
0
 /// <summary>
 /// The default multiplexer creation delegate.
 /// </summary>
 public static async Task <IConnectionMultiplexer> DefaultCreateMultiplexer(RedisClusteringOptions options)
 {
     return(await ConnectionMultiplexer.ConnectAsync(options.ConnectionString));
 }