Skip to content

Commit

Permalink
docs: add LazyCollection explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
phanan committed May 18, 2024
1 parent 3f317bd commit 07f95e7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ The object, however, implements the `__toString` method, so you can cast it to a

The media URL for an episode is available as part of the episode's `enclosure` property, along with the length (in seconds) and media type.

### Why are the episodes returned as an `EpisodeCollection extends LazyCollection` object? What’s a lazy collection anyway?

The `LazyCollection` class leverages [PHP's generators](https://www.php.net/manual/en/language.generators.overview.php) to allow you to work with very large datasets while keeping memory usage low.
Since a podcast feed can potentially contain a large number of episodes, returning a `LazyCollection` allows you to iterate over the episodes without loading them all into memory at once,
speeding up the process and reducing memory consumption.

### Can you support feature X/Y/Z?

Poddle aims to be a lightweight and efficient podcast feed parser that follows the PSP-1 standard, not a full-blown RSS/Atom parser.
Expand Down

0 comments on commit 07f95e7

Please sign in to comment.