public async Task InvokeAsync(HttpContext context, ILocalCache localCache) { using (localCache.StartContext()) { await next(context); } }
public RuleRunnerGrain( IGrainState <State> state, IAppProvider appProvider, ILocalCache localCache, IEventStore eventStore, IEventDataFormatter eventDataFormatter, IRuleEventRepository ruleEventRepository, IRuleService ruleService, ISemanticLog log) { Guard.NotNull(state, nameof(state)); Guard.NotNull(appProvider, nameof(appProvider)); Guard.NotNull(localCache, nameof(localCache)); Guard.NotNull(eventStore, nameof(eventStore)); Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter)); Guard.NotNull(ruleEventRepository, nameof(ruleEventRepository)); Guard.NotNull(ruleService, nameof(ruleService)); Guard.NotNull(log, nameof(log)); this.state = state; this.appProvider = appProvider; this.localCache = localCache; this.eventStore = eventStore; this.eventDataFormatter = eventDataFormatter; this.ruleEventRepository = ruleEventRepository; this.ruleService = ruleService; this.log = log; }
public LocalCacheEventsWrapper( LocalCacheEventsWrapperConfig <TKey, TValue> config, ILocalCache <TKey, TValue> innerCache) : base(innerCache) { _config = config; }
public AppProvider(ILocalCache localCache, IAppsIndex indexForApps, IRulesIndex indexRules, ISchemasIndex indexSchemas) { this.localCache = localCache; this.indexForApps = indexForApps; this.indexRules = indexRules; this.indexSchemas = indexSchemas; }
public JobMasterService(IEncompassEventRepository encompassEventRepository, IJobMasterConfiguration jobPickerConfiguration, ILocalCache localCache) { _encompassEventRepository = encompassEventRepository; _jobPickerConfiguration = jobPickerConfiguration; _cache = localCache; }
private static void AssertCache(ILocalCache cache, string key, object expectedValue, bool expectedFound) { var found = cache.TryGetValue(key, out var value); Assert.Equal(expectedFound, found); Assert.Equal(expectedValue, value); }
public IPipeValidator <TModel> ImportLocalCache(ILocalCache cache) { CheckCacheObject(); _externalCache = new Optional <ILocalCache>(cache); return(this); }
public AssetFolderResolver(ILocalCache localCache, IAssetQueryService assetQuery) { Guard.NotNull(localCache, nameof(localCache)); Guard.NotNull(assetQuery, nameof(assetQuery)); this.localCache = localCache; this.assetQuery = assetQuery; }
public CacheController( IRequestContext context, ILocalCache localCache) { _clientFactory = new CacheCommunicationClientFactory(context, localCache); _context = context; _localCache = localCache; }
public AppProvider(IGrainFactory grainFactory, ILocalCache localCache) { Guard.NotNull(grainFactory, nameof(grainFactory)); Guard.NotNull(localCache, nameof(localCache)); this.grainFactory = grainFactory; this.localCache = localCache; }
public StrategyManagementService(ILogger <StrategyManagementService> logger, IStrategyTradingService strategyTradingService, ILocalCache localCache) : base(TimeSpan.FromMilliseconds(TickFrequencyMilliseconds), logger) { _strategyTradingService = strategyTradingService; _localCache = localCache; }
public LocalCacheAdapter( ILocalCache <TKey, TValue> innerCache, Func <TKey, bool> skipCacheGetPredicate, Func <TKey, TValue, bool> skipCacheSetPredicate) { _innerCache = innerCache; _skipCacheGetPredicate = skipCacheGetPredicate; _skipCacheSetPredicate = skipCacheSetPredicate; }
public Rebuilder( ILocalCache localCache, IEventStore eventStore, IServiceProvider serviceProvider) { this.eventStore = eventStore; this.serviceProvider = serviceProvider; this.localCache = localCache; }
public static void Set <TOuterKey, TInnerKey, TValue>( this ILocalCache <TOuterKey, TInnerKey, TValue> cache, TOuterKey outerKey, TInnerKey innerKey, TValue value, TimeSpan timeToLive) { cache.SetMany(outerKey, new[] { new KeyValuePair <TInnerKey, TValue>(innerKey, value) }, timeToLive); }
public Rebuilder( ILocalCache localCache, IStore <Guid> store, IEventStore eventStore) { this.eventStore = eventStore; this.localCache = localCache; this.store = store; }
private ThumbnailOp(ILocalCache <byte[]> cache, IAsyncFlow <byte[]> async) { var log = TopicLogger.New("thumbnail-op"); _log = log; _cache = cache; _async = async; _helpers = ImageUtilities.New(log); }
public DocumentService(IEncompassClient encompassClient, IRedisCacheApiClient redisCacheClient, ILocalCache cache, IEncompassDocumentRepository documentRepository, IDocumentWorkerConfiguration documentWorkerConfiguration) { _encompassClient = encompassClient; _redisCacheClient = redisCacheClient; _cache = cache; _documentRepository = documentRepository; _documentWorkerConfiguration = documentWorkerConfiguration; }
public CacheCommunicationClientFactory( IRequestContext context, ILocalCache localCache, IServicePartitionResolver resolver = null, IEnumerable <IExceptionHandler> exceptionHandlers = null) : base(resolver, CreateExceptionHandlers(context, exceptionHandlers)) { _localCache = localCache; _context = context; }
public static async Task <T> GetOrCreateAsync <T>(this ILocalCache cache, object key, Func <Task <T> > creator) { if (cache.TryGetValue(key, out var value)) { if (value is T typed) { return(typed); } else { return(default !);
public Rebuilder( ILocalCache localCache, IEventStore eventStore, IServiceProvider serviceProvider, ILogger <Rebuilder> log) { this.eventStore = eventStore; this.serviceProvider = serviceProvider; this.localCache = localCache; this.log = log; }
public Rebuilder( FieldRegistry fieldRegistry, ILocalCache localCache, IStore <Guid> store, IEventStore eventStore) { this.fieldRegistry = fieldRegistry; this.eventStore = eventStore; this.localCache = localCache; this.store = store; }
public DbContextScope(ILocalCache cache, ISettingsStorage settingsStorage) { _parentScope = GetAmbientScope(); _cache = cache; if (_parentScope == null) { _gameContext = new Lazy<IGameContext>(Factory); _settingsContext = new Lazy<ISettingsStorage>(() => settingsStorage); _contentLinkContext = new Lazy<IContentFolderLinkContext>(() => new ContentFolderLinkContext(Common.Paths.LocalDataPath.GetChildFileWithName("folderlink.json"))); } else _nested = true; SetAmbientScope(this); }
public static bool TryGetCache <T>(this ILocalCache cache, string cacheKey, out T val, DateTime?expiry = null) { object obj; if (cache.TryGetCache(cacheKey, out obj, expiry)) { val = (T)obj; return(true); } val = default(T); return(false); }
public static KeyValuePair <TKey, TValue>[] GetMany <TKey, TValue>( this ILocalCache <TKey, TValue> cache, ReadOnlySpan <TKey> keys) { using var memoryOwner = MemoryPool <KeyValuePair <TKey, TValue> > .Shared.Rent(keys.Length); var span = memoryOwner.Memory.Span; var countFound = cache.GetMany(keys, span); return(span.Slice(0, countFound).ToArray()); }
internal static void EmitArray <T>(this ILGenerator il, T[] items, ILocalCache locals) { il.EmitPrimitive(items.Length); il.Emit(OpCodes.Newarr, typeof(T)); for (var i = 0; i < items.Length; i++) { il.Emit(OpCodes.Dup); il.EmitPrimitive(i); il.TryEmitConstant(items[i], typeof(T), locals); il.EmitStoreElement(typeof(T)); } }
public AppProvider(ILocalCache localCache, IAppsIndex indexForApps, IRulesIndex indexRules, ISchemasIndex indexSchemas) { Guard.NotNull(indexForApps, nameof(indexForApps)); Guard.NotNull(indexRules, nameof(indexRules)); Guard.NotNull(indexSchemas, nameof(indexSchemas)); Guard.NotNull(localCache, nameof(localCache)); this.localCache = localCache; this.indexForApps = indexForApps; this.indexRules = indexRules; this.indexSchemas = indexSchemas; }
public Rebuilder( ILocalCache localCache, IStore <Guid> store, IEventStore eventStore) { Guard.NotNull(localCache); Guard.NotNull(store); Guard.NotNull(eventStore); this.eventStore = eventStore; this.localCache = localCache; this.store = store; }
public static T GetOrCreate <T>(this ILocalCache cache, object key, Func <T> task) { if (cache.TryGetValue(key, out var value) && value is T typedValue) { return(typedValue); } typedValue = task(); cache.Add(key, typedValue); return(typedValue); }
public CacheCommunicationClient( CancellationToken token, IRequestContext context, HttpClient httpClient, string address, ILocalCache localCache) { this.HttpClient = httpClient; this.Url = new Uri(address); this.LocalCache = localCache; this.CancellationToken = token; _context = context; }
public DbContexts(ILocalCache cache, Func <ApiContext> apiCacheCreator, ISettingsStorage settingsStorage) { _cache = cache; _apiCacheCreator = apiCacheCreator; _gameContext = new Lazy <IGameContext>(Factory); _apiContext = new Lazy <IApiContext>(ApiFactory); _settingsContext = new Lazy <ISettingsStorage>(() => settingsStorage); _contentLinkContext = new Lazy <IContentFolderLinkContext>( () => new ContentFolderLinkContext( Common.Paths.LocalDataPath.GetChildFileWithName("folderlink.json"))); }
public Rebuilder( ILocalCache localCache, IEventStore eventStore, IServiceProvider serviceProvider) { Guard.NotNull(localCache, nameof(localCache)); Guard.NotNull(serviceProvider, nameof(serviceProvider)); Guard.NotNull(eventStore, nameof(eventStore)); this.eventStore = eventStore; this.serviceProvider = serviceProvider; this.localCache = localCache; }
public DbContextScope(ILocalCache cache, Func<ApiContext> apiContextCreator, ISettingsStorage settingsStorage) { _parentScope = GetAmbientScope(); if (_parentScope == null) _contexts = new DbContexts(cache, apiContextCreator, settingsStorage); else { _contexts = _parentScope._contexts; _nested = true; } SetAmbientScope(this); }
public DbContexts(ILocalCache cache, Func<ApiContext> apiCacheCreator, ISettingsStorage settingsStorage) { _cache = cache; _apiCacheCreator = apiCacheCreator; _gameContext = new Lazy<IGameContext>(Factory); _apiContext = new Lazy<IApiContext>(ApiFactory); _settingsContext = new Lazy<ISettingsStorage>(() => settingsStorage); _contentLinkContext = new Lazy<IContentFolderLinkContext>( () => new ContentFolderLinkContext( Common.Paths.LocalDataPath.GetChildFileWithName("folderlink.json"))); }
public ContentClient() { _localCache = new LocalCache<Content>(); }
public ContentClient(IContentService service, ILocalCache<Content> localCache) { _service = service; _localCache = localCache; }
public void Setup() { _localCache = MockRepository.GenerateMock<ILocalCache>(); _searchService = MockRepository.GenerateMock<ITwitterizerSearchService>(); }
public GameContextJsonImplementation(ILocalCache cache) { _cache = cache; }
public MarkupClient() { _localCache = new LocalCache<string>(); }
public TwitterSearchClient(ILocalCache localCache, ITwitterizerSearchService searchService) { _localCache = localCache; _searchService = searchService; }
public MarkupClient(IMarkupService service) { _service = service; _localCache = new LocalCache<string>(); }
public DownloadCacheManager(ILocalCache localCache) { _localCache = localCache; }
public SettingsStorage(ILocalCache localCache, ISecureCache roamingSecureCache, IUserCache roamingCache) { _localCache = localCache; _roamingSecureCache = roamingSecureCache; _roamingCache = roamingCache; _settings = new Lazy<Settings>(() => Task.Run(() => LoadSettings()).Result); }
public MarkupClient(IMarkupService service, ILocalCache<string> localCache) { _service = service; _localCache = localCache; }