public void Flush(IEnumerable <TimestampedEvent> events) { if (events.Any()) { _serializer.WriteEventHeader(_writer); _serializer.Write(events, _writer); } }
public void Flush(IEnumerable <TimestampedEvent> events) { if (events.Any()) { foreach (var partition in events.Partition((a, b) => !_fileNamingStrategy.EqualNames(a, b))) { var fileName = _fileNamingStrategy.BaseName(partition.First()) + "." + _serializer.FileExtension; using (var w = CreateOrOpen(fileName, writer => _serializer.WriteEventHeader(writer))) _serializer.Write(partition, w); } } }