/// <summary> /// Queues an error into the backup/retry queue /// </summary> /// <remarks>These will be written to the store when we're able to connect again</remarks> public void QueueError(Error e) { // try and rollup in the queue, to save space foreach (var err in WriteQueue.Where(err => e.ErrorHash == err.ErrorHash)) { err.DuplicateCount++; return; } // only queue if we're under the cap if (WriteQueue.Count < BackupQueueSize) { WriteQueue.Enqueue(e); } // spin up the retry mechanism BeginRetry(); }