Exemplo n.º 1
0
        public static SubscriptionRepository Create(String eventStoreConnectionString, Int32 cacheDuration = 120)
        {
            EventStoreClientSettings settings = EventStoreClientSettings.Create(eventStoreConnectionString);
            HttpClient httpClient             = SubscriptionWorkerHelper.CreateHttpClient(settings);

            return(new SubscriptionRepository(cacheDuration)
            {
                GetAllSubscriptions = cancellationToken => SubscriptionRepository.GetSubscriptions(httpClient, cancellationToken)
            });
        }
Exemplo n.º 2
0
        private SubscriptionRepository(Int32 cacheDuration = 120)
        {
            this.Subscriptions = new PersistentSubscriptions();

            this.RefreshRequired = (force, s) => force || s.InitialState || SubscriptionRepository.RefreshNeeded(s.LastTimeRefreshed, cacheDuration);
        }