• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IRedisClientsManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: RateLimitFeatureTests

        public RateLimitFeatureTests()
        {
            redisManager = A.Fake<IRedisClientsManager>();
            limitProvider = A.Fake<ILimitProvider>();
            keyGenerator = A.Fake<ILimitKeyGenerator>();

            var fixture = new Fixture().Customize(new AutoFakeItEasyCustomization());
            limit = fixture.Create<Limits>();
            A.CallTo(() => limitProvider.GetLimits(A<IRequest>.Ignored)).Returns(limit);
        }
开发者ID:yonglehou,项目名称:servicestack-ratelimit-redis,代码行数:10,代码来源:RateLimitFeatureTests.cs


示例17: QueueManager

		public QueueManager(
			ISerializer serializer, 
			IRedisClientsManager clientManager, 
			IQueueKeyNameProvider keyNameProvider)
		{
			_serializer = serializer;
			_clientManager = clientManager;
			_keyNameProvider = keyNameProvider;
			_log = log4net.LogManager.GetLogger(typeof(QueueManager));
		}
开发者ID:mackie1001,项目名称:NServicebus.Redis,代码行数:10,代码来源:QueueManager.cs


示例18: ConfigurationSvc

 /// <summary>
 /// Constructor
 /// </summary>
 public ConfigurationSvc(IRedisClientsManager redisManager,
     ILoggerFactory loggerFactory)
     : base(loggerFactory)
 {
     this.redisManager = redisManager;
     string tmp = ConfigurationManager.AppSettings["BHSConfigKeyPrefix"];
     configKeyPrefix = (!string.IsNullOrEmpty(tmp)) ? tmp : "BHS:ConfigKey:";
     configKeyPrefix = StringUtils.MustEndWith(configKeyPrefix, ":");
     logger.Info("Using " + configKeyPrefix + " as prefix for configuration keys in Redis");
 }
开发者ID:shj333,项目名称:dotnet_utils,代码行数:13,代码来源:ConfigurationSvc.cs


示例19: CalendarRedisRepository

        /// <summary>
        ///
        /// </summary>
        /// <param name="keygenerator"></param>
        /// <param name="eventrepository"></param>
        /// <param name="manager"></param>
        public CalendarRedisRepository(IKeyGenerator<Guid> keygenerator, IEventRepository eventrepository, IRedisClientsManager manager)
        {
            if (keygenerator == null) throw new ArgumentNullException(nameof(keygenerator));
            this.keygenerator = keygenerator;

            if (eventrepository == null) throw new ArgumentNullException(nameof(eventrepository));
            this.eventrepository = eventrepository;

            if (manager == null) throw new ArgumentNullException(nameof(manager));
            this.manager = manager;
        }
开发者ID:reexjungle,项目名称:xcal,代码行数:17,代码来源:calendar.redis.repository.cs


示例20: RedisPubSubServer

        public RedisPubSubServer(IRedisClientsManager clientsManager, params string[] channels)
        {
            this.ClientsManager = clientsManager;
            this.Channels = channels;

            var failoverHost = clientsManager as IRedisFailover;
            if (failoverHost != null)
            {
                failoverHost.OnFailover.Add(HandleFailover);
            }
        }
开发者ID:PKRoma,项目名称:ServiceStack.Redis,代码行数:11,代码来源:RedisPubSubServer.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IReference类代码示例发布时间:2022-05-24
下一篇:
C# IRedisClient类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap