Example #1
0
 public void NotifyRecordsAdded(LogRecord[] newRecords, long firstNewRecord, long lastNewRecord)
 {
     lockSlim.EnterReadLock();
     onRecordsAddedChunkedDelegates
         .AsParallel()
         .ForAll(x => x(firstNewRecord, lastNewRecord));
     onRecordsAddedDelegates
         .AsParallel()
         .ForAll(x => x(newRecords));
     lockSlim.ExitReadLock();
 }
 public void Log(string eventType, params object[] eventArgs)
 {
     var logRecord = new LogRecord(Interlocked.Increment(ref logIndex), new TmpLogRecord(eventType, eventArgs));
     action(logRecord);
 }
 public void Add(LogRecord logRecord)
 {
     long index = chunkedArray.Count;
     chunkedArray.Add(logRecord);
     var logRecords = new[] { logRecord };
     onRecordsAdded.ForEach(x => x(logRecords));
     onRecordsAddedChunked.ForEach(x => x(index, index));
 }