Пример #1
0
        private void ProduceDeletedFiles(string directory)
        {
            var snapshot = new DirectorySnapshot(directory, _searchOption);

            while (!_deletedQueue.IsAddingCompleted)
            {
                SpinWait.SpinUntil(() => false, Interval);
                ProduceDeletedSnapshot(snapshot);
            }
        }
Пример #2
0
 private void ProduceDeletedSnapshot(DirectorySnapshot snapshot)
 {
     try {
         snapshot.CreateSnapshot();
         var snapshots = snapshot.GetDeletedSnapshots(Filters);
         var messages  = snapshots.Select(x => ReadSnapshot(x)).ToArray();
         _deletedQueue.Produce(_producerTokenSource.Token, messages);
     } catch (Exception e) {
         OnException?.Invoke(this, e);
     }
 }
Пример #3
0
        private void ProduceCreatedFiles(string directory)
        {
            var snapshot = new DirectorySnapshot(directory, _searchOption);

            if (!IncludeExistingFiles)
            {
                snapshot.CreateSnapshot();
            }
            while (!_createdQueue.IsAddingCompleted)
            {
                SpinWait.SpinUntil(() => false, Interval);
                ProduceCreatedSnapshot(snapshot);
            }
        }