Skip to content

Conversation

clue
Copy link
Owner

@clue clue commented Oct 4, 2025

This changeset adds a new $flush parameter to control the flush mode for Compressor. This is particularly useful for streaming protocols like WebSocket/EventSource to make sure data can be received immediately after writing with ZLIB_SYNC_FLUSH.

Builds on top of #30 and #28

@clue clue requested a review from Copilot October 4, 2025 12:29
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new $flush parameter to the Compressor class constructor to control the compression flush mode, enabling immediate data availability for streaming protocols like WebSocket and EventSource through ZLIB_SYNC_FLUSH.

  • Added optional $flush parameter to Compressor constructor with validation
  • Updated transformData method to use the specified flush mode instead of hardcoded ZLIB_NO_FLUSH
  • Added comprehensive test coverage for different flush modes including default, sync flush, and finish flush behaviors

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/Compressor.php Added flush parameter with validation and updated transform logic to use it
tests/CompressorTest.php Added test for invalid flush mode validation
tests/GzipCompressorTest.php Added extensive tests for different flush modes and their output behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@clue clue force-pushed the flush-compressor branch 3 times, most recently from 841b6ea to 496c1c6 Compare October 4, 2025 12:45
@clue clue force-pushed the flush-compressor branch from 496c1c6 to a7765d8 Compare October 4, 2025 12:49
@clue clue requested a review from Copilot October 4, 2025 12:50
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@clue clue merged commit 49f6811 into clue:1.x Oct 4, 2025
20 checks passed
@clue clue deleted the flush-compressor branch October 4, 2025 12:54
@clue clue added this to the v1.3.0 milestone Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant