コード例 #1
0
        private void PublishEvent(string cacheKey, EventType eventType, string backendUniqueIdentifier)
        {
            var cacheKeyEvent = new CacheKeyEvent {
                CacheKey = cacheKey, EventType = eventType, CacheBackendIdentifier = backendUniqueIdentifier
            };

            _queueClient.Publish(EventPublishingExchange, EventPublishingRoute, cacheKeyEvent);
        }
コード例 #2
0
        private Task PropagateEventAsync(CacheKeyEvent cacheKeyEvent, CancellationToken cancellationToken)
        {
            var elegibleBackends = _cacheBackends.TakeWhile(
                backend => backend.GetUniqueIdentifier() != cacheKeyEvent.CacheBackendIdentifier);

            var deleteTasks = elegibleBackends.Select(backend => backend.DeleteAsync(cacheKeyEvent.CacheKey));

            return(Task.WhenAll(deleteTasks));
        }