Exemplo n.º 1
0
        private IEnumerable <IProcessingElement> FetchFromPersistentStoreAndCorrelateWithBuffer()
        {
            var fetchedFromPersistentStore = _persistentStore.Fetch(null, _fetchSize);

            if (!fetchedFromPersistentStore.Any() || CorrelateWithBufffer(fetchedFromPersistentStore))
            {
                _inMemoryMode = true;
            }
            return(fetchedFromPersistentStore);
        }
Exemplo n.º 2
0
        private IEnumerable <IProcessingElement> FetchFromPersistentStoreAndCorrelateWithBuffer(string pipelineName)
        {
            // We need to copy the fetched items to prevent fetchedFromPersistentStore.Any()
            // and/or CorrelateWithBufffer consuming events and not returning them.
            // Rx extensions MemoizeAll would be a good solution, but I'm not sure we want
            // an extra dependency, ToList is fine as long as _fetchSize is reasonable.
            var fetchedFromPersistentStore = _persistentStore.Fetch(pipelineName, _fetchSize).ToList();

            if (!fetchedFromPersistentStore.Any() || CorrelateWithBufffer(fetchedFromPersistentStore))
            {
                _inMemoryMode = true;
            }
            return(fetchedFromPersistentStore);
        }
Exemplo n.º 3
0
 private void Fetch(FetchDirective directive)
 {
     lock (_fetchLock)
     {
         _activeFetchRequest = true;
         var elements = _elementStore.Fetch(_pipelineName, directive.MaxCount);
         foreach (var element in elements)
         {
             element.SequenceNumber = _sequence++;
             OnElementFetched(new ElementFetchedEventArgs(element));
         }
         _activeFetchRequest = false;
     }
 }
 public IEnumerable <IProcessingElement> Fetch(string pipelineName, int maxCount)
 {
     return(_wrappedStore.Fetch(pipelineName, maxCount));
 }