示例#1
0
        public void Write(JournalEntry item)
        {
            if (_stream == null) _stream = _storage.CreateJournalWriterStream(item.Id);
            if (_rolloverStrategy.Rollover(_stream.Position, _entriesWrittenToCurrentStream))
            {
                _log.Debug("NewJournalSegment");
                Close();
                _stream = _storage.CreateJournalWriterStream(item.Id);
                _entriesWrittenToCurrentStream = 0;
            }

            _journalFormatter.WriteBuffered(_stream, item);
            _stream.Flush();
            _entriesWrittenToCurrentStream++;
        }
示例#2
0
        public void Write(JournalEntry entry)
        {
            if (_stream == null) _stream = _streamProvider.Invoke(entry.Id);
            if (_rolloverStrategy.Rollover(_stream.Position, _entriesWrittenToCurrentStream))
            {
                _log.Debug("NewJournalSegment");
                Close();
                _stream = _streamProvider.Invoke(entry.Id);
                _entriesWrittenToCurrentStream = 0;
            }

            _journalFormatter.WriteBuffered(_stream, entry);
            _stream.Flush();
            _entriesWrittenToCurrentStream++;
        }
 public void Write(JournalEntry item)
 {
     _queue.Add(item);
 }