示例#1
0
        public async Task Retry(DirectoryChange retryingDirectory)
        {
            TimeSpan delay    = TimeSpan.FromSeconds(10);
            TimeSpan maxDelay = TimeSpan.FromMinutes(10);

            while (true)
            {
                await Task.Delay(delay);

                lock (syncObject)
                {
                    if (TryProcess(retryingDirectory))
                    {
                        retryingDirectories.Remove(retryingDirectory);
                        return;
                    }
                }

                delay = delay + delay;
                if (delay > maxDelay)
                {
                    delay = maxDelay;
                }
            }
        }
示例#2
0
        public override bool Equals(object obj)
        {
            DirectoryChange obj1 = obj as DirectoryChange;

            if (obj1 == null)
            {
                return(false);
            }

            return(Side == obj1.Side && FileName == obj1.FileName);
        }
示例#3
0
        private void Enqueue(DirectoryChange item)
        {
            lock (DoubleDelayedQueueSyncObj)
            {
                if (initialBuffer == null)
                {
                    initialBuffer = new HashSet <DirectoryChange>();
                    Task.Run(DoubleDelayedTask);
                }

                initialBuffer.Add(item);
            }
        }
示例#4
0
 private void Enqueue(DirectoryChange change)
 {
 }
示例#5
0
 public bool TryProcess(DirectoryChange task)
 {
     return(false);
 }
示例#6
0
 private void EnqueueImediately(DirectoryChange item)
 {
     Queue.Add(item);
 }