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; } } }
public override bool Equals(object obj) { DirectoryChange obj1 = obj as DirectoryChange; if (obj1 == null) { return(false); } return(Side == obj1.Side && FileName == obj1.FileName); }
private void Enqueue(DirectoryChange item) { lock (DoubleDelayedQueueSyncObj) { if (initialBuffer == null) { initialBuffer = new HashSet <DirectoryChange>(); Task.Run(DoubleDelayedTask); } initialBuffer.Add(item); } }
private void Enqueue(DirectoryChange change) { }
public bool TryProcess(DirectoryChange task) { return(false); }
private void EnqueueImediately(DirectoryChange item) { Queue.Add(item); }