本文整理汇总了C#中ICacheClient类的典型用法代码示例。如果您正苦于以下问题:C# ICacheClient类的具体用法?C# ICacheClient怎么用?C# ICacheClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICacheClient类属于命名空间,在下文中一共展示了ICacheClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DacheMvcChildActionCache
/// <summary>
/// The constructor.
/// </summary>
/// <param name="cacheClient">The cache client.</param>
public DacheMvcChildActionCache(ICacheClient cacheClient)
: base("Dache MVC Child Action Cache")
{
// Sanitize
if (cacheClient == null)
{
throw new ArgumentNullException("cacheClient");
}
_cacheClient = cacheClient;
}
示例2: SessionPlugin
public SessionPlugin(ICacheClient cacheClient, IEventRepository eventRepository, AssignToStackAction assignToStack, UpdateStatsAction updateStats, LocationPlugin locationPlugin, ILoggerFactory loggerFactory = null) : base(loggerFactory) {
_cacheClient = new ScopedCacheClient(cacheClient, "session");
_eventRepository = eventRepository;
_assignToStack = assignToStack;
_updateStats = updateStats;
_locationPlugin = locationPlugin;
}
示例3: SetLocationFromGeoWorkItemHandler
public SetLocationFromGeoWorkItemHandler(ICacheClient cacheClient, IEventRepository eventRepository, IGeocodeService geocodeService, IMetricsClient metricsClient, IMessageBus messageBus, ILoggerFactory loggerFactory = null) : base(loggerFactory) {
_cacheClient = new ScopedCacheClient(cacheClient, "geo");
_eventRepository = eventRepository;
_geocodeService = geocodeService;
_metricsClient = metricsClient;
_lockProvider = new CacheLockProvider(cacheClient, messageBus);
}
示例4: StatsController
public StatsController(ErrorStatsHelper statsHelper, IOrganizationRepository organizationRepository, IErrorStackRepository errorStackRepository, IProjectRepository projectRepository, ICacheClient cacheClient) {
_cacheClient = cacheClient;
_statsHelper = statsHelper;
_organizationRepository = organizationRepository;
_errorStackRepository = errorStackRepository;
_projectRepository = projectRepository;
}
示例5: ThrottleBotsPlugin
public ThrottleBotsPlugin(ICacheClient cacheClient, IEventRepository eventRepository, IProjectRepository projectRepository, IMetricsClient metricsClient, IQueue<WorkItemData> workItemQueue) {
_cacheClient = cacheClient;
_metricsClient = metricsClient;
_eventRepository = eventRepository;
_projectRepository = projectRepository;
_workItemQueue = workItemQueue;
}
示例6: AccountController
public AccountController(IDbConnection db, IMetricTracker metrics, ICacheClient cache, IMailController mailController, IUserService userService, IUserAuthenticationService authenticationService)
: base(db, metrics, cache)
{
_mailController = mailController;
_userService = userService;
_authenticationService = authenticationService;
}
示例7: SystemHealthChecker
public SystemHealthChecker(ICacheClient cacheClient, IElasticClient elasticClient, IFileStorage storage, IQueue<StatusMessage> queue, IMessageBus messageBus) {
_cacheClient = cacheClient;
_elasticClient = elasticClient;
_storage = storage;
_queue = queue;
_messageBus = messageBus;
}
示例8: ThrottlingHandler
public ThrottlingHandler(ICacheClient cacheClient, IMetricsClient metricsClient, Func<string, long> maxRequestsForUserIdentifier, TimeSpan period, string message = "The allowed number of requests has been exceeded.") {
_cacheClient = cacheClient;
_metricsClient = metricsClient;
_maxRequestsForUserIdentifier = maxRequestsForUserIdentifier;
_period = period;
_message = message;
}
示例9: AutoSessionPlugin
public AutoSessionPlugin(ICacheClient cacheClient, IEventRepository eventRepository, AssignToStackAction assignToStack, UpdateStatsAction updateStats, LocationPlugin locationPlugin) {
_cacheClient = new ScopedCacheClient(cacheClient, "session");
_eventRepository = eventRepository;
_assignToStack = assignToStack;
_updateStats = updateStats;
_locationPlugin = locationPlugin;
}
示例10: MyAppElasticConfiguration
public MyAppElasticConfiguration(IQueue<WorkItemData> workItemQueue, ICacheClient cacheClient, IMessageBus messageBus, ILoggerFactory loggerFactory) : base(workItemQueue, cacheClient, messageBus, loggerFactory) {
AddIndex(Identities = new IdentityIndex(this));
AddIndex(Employees = new EmployeeIndex(this));
AddIndex(MonthlyEmployees = new MonthlyEmployeeIndex(this, 1));
AddIndex(DailyLogEvents = new DailyLogEventIndex(this));
AddIndex(MonthlyLogEvents = new MonthlyLogEventIndex(this));
AddIndex(ParentChild = new ParentChildIndex(this));
}
示例11: BaseController
protected BaseController(IDbConnection db, IMetricTracker metrics, ICacheClient cache)
{
Db = db;
Metrics = metrics;
Log = LogManager.GetLogger(GetType());
Cache = cache;
CacheContext = new CacheContext(Cache);
}
示例12: RemoveProjectWorkItemHandler
public RemoveProjectWorkItemHandler(IProjectRepository projectRepository, IEventRepository eventRepository, IStackRepository stackRepository, ITokenRepository tokenRepository, IWebHookRepository webHookRepository, ICacheClient cacheClient, IMessageBus messageBus, ILoggerFactory loggerFactory = null) : base(loggerFactory) {
_projectRepository = projectRepository;
_eventRepository = eventRepository;
_stackRepository = stackRepository;
_tokenRepository = tokenRepository;
_webHookRepository = webHookRepository;
_lockProvider = new CacheLockProvider(cacheClient, messageBus);
}
示例13: CacheBucketMetricsClientBase
public CacheBucketMetricsClientBase(ICacheClient cache, bool buffered = true, string prefix = null, ILoggerFactory loggerFactory = null) {
_logger = loggerFactory.CreateLogger(GetType());
_cache = cache;
_buffered = buffered;
_prefix = !String.IsNullOrEmpty(prefix) ? (!prefix.EndsWith(":") ? prefix + ":" : prefix) : String.Empty;
if (buffered)
_flushTimer = new Timer(OnMetricsTimer, null, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(2));
}
示例14: DailySummaryJob
public DailySummaryJob(IProjectRepository projectRepository, IOrganizationRepository organizationRepository, IUserRepository userRepository, IEventRepository eventRepository, EventStats stats, IMailer mailer, ICacheClient cacheClient, ILoggerFactory loggerFactory = null) : base(loggerFactory) {
_projectRepository = projectRepository;
_organizationRepository = organizationRepository;
_userRepository = userRepository;
_eventRepository = eventRepository;
_stats = stats;
_mailer = mailer;
_lockProvider = new ThrottlingLockProvider(cacheClient, 1, TimeSpan.FromHours(1));
}
示例15: ThrottlingLockProvider
public ThrottlingLockProvider(ICacheClient cacheClient, int maxHitsPerPeriod = 100, TimeSpan? throttlingPeriod = null) {
_cacheClient = cacheClient;
_maxHitsPerPeriod = maxHitsPerPeriod;
if (maxHitsPerPeriod <= 0)
throw new ArgumentException("Must be a positive number.", nameof(maxHitsPerPeriod));
if (throttlingPeriod.HasValue)
_throttlingPeriod = throttlingPeriod.Value;
}