Skip to content

Support all streaming flush modes for Compressor - #45

Merged
clue merged 2 commits into
clue:1.xfrom
clue-labs:flush-modes
Oct 9, 2026
Merged

clue merged 2 commits into
clue:1.xfrom
clue-labs:flush-modes

Conversation

@clue

@clue clue commented Oct 9, 2026

Copy link
Copy Markdown
Owner

This changeset updates the $flush parameter for Compressor to support all streaming flush modes. This adds support for ZLIB_PARTIAL_FLUSH and no longer accepts ZLIB_FINISH, which would end the gzip stream after each write, so gzdecode() and similar consumers would silently discard everything after the first chunk. ZLIB_BLOCK is not supported either, as zlib reserves it for advanced applications where the receiving side may not be able to decompress the data written so far.

This also documents both the $level and $flush parameters. ZLIB_FINISH was only added in #41 and has not been released yet, so this does not affect any existing users.

Builds on top of #41 and #28

@clue clue added the new feature New feature or request label Oct 9, 2026
@clue clue added this to the v1.3.0 milestone Oct 9, 2026
@clue
clue requested a balanced review from Copilot October 9, 2026 23:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation, documentation, and tests consistently support the intended streaming flush modes.

0 open findings

What changed in this PR

Extends Compressor flush-mode support while preventing premature gzip stream termination.

Changes:

  • Adds ZLIB_PARTIAL_FLUSH and rejects ZLIB_FINISH.
  • Documents compression-level and flush behavior.
  • Updates validation and flush-mode tests.
File Description
src/​Compressor.php Updates validation and API documentation.
README.md Documents compression and flush options.
tests/​CompressorTest.php Tests accepted-mode validation.
tests/​GzipCompressorTest.php Covers partial, sync, and full flushing.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@clue
clue merged commit 2253e05 into clue:1.x Oct 9, 2026
22 checks passed
@clue
clue deleted the flush-modes branch October 9, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants