示例#1
0
 public FetchDirective ShouldFetch(PipelineState currentState)
 {
     if (currentState.PendingEventCount < _minimumPendingEvents)
     {
         return(FetchDirective.FetchNow(Guid.NewGuid(), _batchSize));
     }
     return(FetchDirective.DoNotFetchYet());
 }
示例#2
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;
     }
 }
示例#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;
     }
 }
 private void StartFetching(FetchDirective directive)
 {
     Task.Factory.StartNew(() => Fetch(directive));
 }
示例#5
0
 private void StartFetching(FetchDirective directive)
 {
     Task.Factory.StartNew(() => Fetch(directive));
 }