Add new $flush parameter to control flush mode for Compressor#41
Merged
Add new $flush parameter to control flush mode for Compressor#41
$flush parameter to control flush mode for Compressor#41Conversation
There was a problem hiding this comment.
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
$flushparameter toCompressorconstructor with validation - Updated
transformDatamethod to use the specified flush mode instead of hardcodedZLIB_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.
841b6ea to
496c1c6
Compare
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changeset adds a new
$flushparameter to control the flush mode forCompressor. This is particularly useful for streaming protocols like WebSocket/EventSource to make sure data can be received immediately after writing withZLIB_SYNC_FLUSH.Builds on top of #30 and #28