当前位置: 首页>>代码示例>>C#>>正文


C# IRedisClientsManager类代码示例

本文整理汇总了C#中IRedisClientsManager的典型用法代码示例。如果您正苦于以下问题:C# IRedisClientsManager类的具体用法?C# IRedisClientsManager怎么用?C# IRedisClientsManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IRedisClientsManager类属于命名空间,在下文中一共展示了IRedisClientsManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RedisErrorLoggerFeature

        public RedisErrorLoggerFeature(IRedisClientsManager redisManager)
        {
            if (redisManager == null)
                throw new ArgumentNullException("redisManager");

            this.redisManager = redisManager;
        }
开发者ID:rjdudley,项目名称:ServiceStack,代码行数:7,代码来源:RedisErrorLoggerFeature.cs

示例2: RedisMessageHandlerWorker

 public RedisMessageHandlerWorker(
     IRedisClientsManager clientsManager, IMessageHandler messageHandler, string queueName,
     Action<IMessageHandlerBackgroundWorker, Exception> errorHandler)
     : base(messageHandler, queueName, errorHandler)
 {
     this.clientsManager = clientsManager;
 }
开发者ID:adam-26,项目名称:ServiceStack.Redis,代码行数:7,代码来源:RedisMessageHandlerWorker.cs

示例3: RedisQueue

		public RedisQueue(
			ISerializer serializer, 
			IRedisClientsManager clientManager,
			IQueueKeyNameProvider keyNameProvider
			)
			: this(serializer, clientManager, keyNameProvider, 60)
		{ }
开发者ID:mackie1001,项目名称:NServicebus.Redis,代码行数:7,代码来源:RedisQueue.cs

示例4: RepositoryProxy

 public RepositoryProxy(IDbConnectionFactory dbConnectionFactory, IRedisClientsManager redisClientsManager)
 {
     DbConnectionFactory= dbConnectionFactory;
     RedisClientsManager= redisClientsManager;
     CreateCommand();
     CreateRedisClient();
 }
开发者ID:angelcolmenares,项目名称:Calamar,代码行数:7,代码来源:RepositoryProxy.cs

示例5: UseClient

		private static void UseClient(IRedisClientsManager manager, int clientNo)
		{
			var cacheManager = (IRedisClientCacheManager)manager;

			var host = "";

			try
			{
				using (var client = cacheManager.GetReadOnlyCacheClient())
				{
					host = ((IRedisClient)client).Host;
					Log("Client '{0}' is using '{1}'", clientNo, host);

					var testClientKey = "test:" + host + ":" + clientNo;
					client.Set(testClientKey, testData);
					var result = client.Get<string>(testClientKey) ?? "";

					Log("\t{0} => {1} len {2} {3} len", testClientKey,
						testData.Length, testData.Length == result.Length ? "==" : "!=", result.Length);
				}
			}
			catch (NullReferenceException ex)
			{
				Log("NullReferenceException StackTrace: \n" + ex.StackTrace);
			}
			catch (Exception ex)
			{
				Log("\t[[email protected]{0}]: {1} => {2}",
					host, ex.GetType().Name, ex.Message);
			}
		}
开发者ID:nuxleus,项目名称:ServiceStack.Redis,代码行数:31,代码来源:MultiThreadedCacheClientManagerIntegrationTests.cs

示例6: RedisTransientMessageFactory

		public RedisTransientMessageFactory(int retryAttempts, TimeSpan? requestTimeOut,
			IRedisClientsManager clientsManager)
		{
			this.ClientsManager = clientsManager ?? new BasicRedisClientManager();
			MessageService = new RedisTransientMessageService(
				retryAttempts, requestTimeOut, this);
		}
开发者ID:Guiedo,项目名称:BehaviorIsManaged,代码行数:7,代码来源:RedisTransientMessageFactory.cs

示例7: UseClientAsync

		private static void UseClientAsync(IRedisClientsManager manager, int clientNo)
		{
			using (var client = manager.GetReadOnlyClient())
			{
				UseClient(client, clientNo);
			}
		}
开发者ID:Chevkio,项目名称:ServiceStack.Redis,代码行数:7,代码来源:RedisRegressionTestRun.cs

示例8: RedisCache

        public RedisCache(string regionName, IDictionary<string, string> properties, RedisCacheElement element, IRedisClientsManager clientManager)
        {
            this.serializer = new ObjectSerializer();
            this.clientManager = clientManager.ThrowIfNull("clientManager");
            RegionName = regionName.ThrowIfNull("regionName");

            expirySeconds = element != null
                ? (int)element.Expiration.TotalSeconds
                : PropertiesHelper.GetInt32(NHibernate.Cfg.Environment.CacheDefaultExpiration, properties, DefaultExpiry);

            log.DebugFormat("using expiration : {0} seconds", expirySeconds);

            var regionPrefix = PropertiesHelper.GetString(NHibernate.Cfg.Environment.CacheRegionPrefix, properties, null);
            log.DebugFormat("using region prefix : {0}", regionPrefix);

            CacheNamePrefix = element != null ? element.CachePrefix : string.Empty;

            var namespacePrefix = CacheNamePrefix + RegionName;
            if (!String.IsNullOrWhiteSpace(regionPrefix))
            {
                namespacePrefix = regionPrefix + ":" + namespacePrefix;
            }

            CacheNamespace = new RedisNamespace(namespacePrefix);
            SyncGeneration();
        }
开发者ID:cerasumat,项目名称:CacheRedis,代码行数:26,代码来源:RedisCache.cs

示例9: RegisterLuaScript

 public static string RegisterLuaScript(IRedisClientsManager clientManager)
 {
     using (var client = clientManager.GetClient())
     {
         string scriptSha1 = client.LoadLuaScript(GetLuaScript());
         return scriptSha1;
     }
 }
开发者ID:yonglehou,项目名称:servicestack-ratelimit-redis,代码行数:8,代码来源:LuaScriptHelpers.cs

示例10: RedisQueueHandlerWorker

        private readonly IRedisClientsManager clientsManager; //Thread safe redis client/conn factory

        public RedisQueueHandlerWorker(IRedisClientsManager clientsManager, RedisMqServer mqServer, string queueName, Action<IQueueHandlerBackgroundWorker, Exception> errorHandler) 
            : base(queueName, errorHandler)
        {            
            if (clientsManager == null) throw new ArgumentNullException("clientsManager");
            if (mqServer == null) throw new ArgumentNullException("mqServer");
            this.clientsManager = clientsManager;
            this.MqServer = mqServer;
        }
开发者ID:adam-26,项目名称:ServiceStack.Redis,代码行数:10,代码来源:RedisQueueHandlerWorker.cs

示例11: AudioAlarmRedisRepository

        public AudioAlarmRedisRepository(IKeyGenerator<Guid> keygenerator, IRedisClientsManager manager)
        {
            if (keygenerator == null) throw new ArgumentNullException(nameof(keygenerator));
            if (manager == null) throw new ArgumentNullException(nameof(manager));

            this.keygenerator = keygenerator;
            this.manager = manager;
        }
开发者ID:reexjungle,项目名称:xcal,代码行数:8,代码来源:alarm.redis.repositories.cs

示例12: SetClientManager

 public static void SetClientManager(IRedisClientsManager clientManager)
 {
     if (clientManagerStatic != null)
     {
         throw new InvalidOperationException("Redis Client Manager只能配置一次.");
     }
     clientManagerStatic = clientManager.ThrowIfNull();
 }
开发者ID:cerasumat,项目名称:CacheRedis,代码行数:8,代码来源:RedisCacheProvider.cs

示例13: MessageHandlerWorker

 public MessageHandlerWorker(
     IRedisClientsManager clientsManager, IMessageHandler messageHandler, string queueName,
     Action<MessageHandlerWorker, Exception> errorHandler)
 {
     this.clientsManager = clientsManager;
     this.messageHandler = messageHandler;
     this.QueueName = queueName;
     this.errorHandler = errorHandler;
 }
开发者ID:AVee,项目名称:ServiceStack,代码行数:9,代码来源:MessageHandlerWorker.cs

示例14: SetClientManager

		/// <summary>
		/// Sets the client manager to be used for the session state provider. 
		/// This client manager's lifetime will not be managed by the RedisSessionStateProvider.
		/// However, if this is not set, a client manager will be created and
		/// managed by the RedisSessionStateProvider.
		/// </summary>
		/// <param name="clientManager"></param>
		public static void SetClientManager(IRedisClientsManager clientManager)
		{
			if (clientManager == null) throw new ArgumentNullException();
			if (clientManagerStatic != null)
			{
				throw new InvalidOperationException("The client manager can only be configured once.");
			}
			clientManagerStatic = clientManager;
		}
开发者ID:kevinpriester,项目名称:EktronContrib,代码行数:16,代码来源:RedisSessionStateStore.cs

示例15: IdGeneratorSvc

 /// <summary>
 /// Constructor
 /// </summary>
 public IdGeneratorSvc(IRedisClientsManager redisManager,
     IConfigurationSvc configurationSvc,
     ILoggerFactory loggerFactory)
 {
     this.redisManager = redisManager;
     logger = loggerFactory.GetLogger(GetType());
     idKeyPrefix = configurationSvc.GetStringConfig("IdGenerator:$Internal$:KeyPrefix", "BHS:IdGenKey:");
     idKeyPrefix = StringUtils.MustEndWith(idKeyPrefix, ":");
     logger.Info("Using " + idKeyPrefix + " as prefix for id generation keys in Redis");
 }
开发者ID:shj333,项目名称:dotnet_utils,代码行数:13,代码来源:IdGeneratorSvc.cs


注:本文中的IRedisClientsManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。