-
Notifications
You must be signed in to change notification settings - Fork 216
Open
Labels
Description
Overview
Implement true streaming support for gofeed to handle large feeds efficiently without loading entire documents into memory.
Tasks
Feed Detection
- Rewrite feed type detection to use fixed-size buffer (e.g., 8KB)
- Use
io.MultiReader
to reconstruct complete reader after detection - Ensure no data is lost during detection phase
Streaming Parse Methods
- Design streaming API that returns iterator/channel of items
- Implement for each format (RSS, Atom, JSON)
- Add MaxItems support that actually stops reading (not just skipping)
- Consider error handling in streaming context
Benefits
- Handle arbitrarily large feeds without memory issues
- Process items as they're parsed rather than after full parse
- True MaxItems support that stops reading early
- Better performance for large feeds
API Considerations
// Possible API designs
iter, err := parser.ParseStream(reader, opts)
for iter.Next() {
item := iter.Item()
// Process item
}
// Or channel-based
items, errs := parser.ParseStreamChan(reader, opts)
for item := range items {
// Process item
}
Related Issues
- Part of v2 RFC (RFC: gofeed v2 – Proposed Changes #241)
Edgaras1shashaBot