Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HttpClient] yield a last chunk for completed responses also #30513

Merged
merged 1 commit into from Mar 12, 2019

Conversation

Projects
None yet
2 participants
@nicolas-grekas
Copy link
Member

nicolas-grekas commented Mar 11, 2019

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

When a response completed, streaming it again yields no chunks right now.
This PR makes it yield a LastChunk - or an ErrorChunk when applicable.
The reasoning for the previous behavior was that streams should yield only activity from the network.
But this looks more complex to use in practice. The proposed behavior is simpler to reason about I think.

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:hc-last-chunk branch from 9b339ca to e11ef7e Mar 11, 2019

@nicolas-grekas nicolas-grekas merged commit e11ef7e into symfony:master Mar 12, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details

nicolas-grekas added a commit that referenced this pull request Mar 12, 2019

bug #30513 [HttpClient] yield a last chunk for completed responses al…
…so (nicolas-grekas)

This PR was merged into the 4.3-dev branch.

Discussion
----------

[HttpClient] yield a last chunk for completed responses also

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

When a response completed, streaming it again yields no chunks right now.
This PR makes it yield a `LastChunk` - or an `ErrorChunk` when applicable.
The reasoning for the previous behavior was that streams should yield only activity from the network.
But this looks more complex to use in practice. The proposed behavior is simpler to reason about I think.

Commits
-------

e11ef7e [HttpClient] yield a last chunk for completed responses also

@nicolas-grekas nicolas-grekas deleted the nicolas-grekas:hc-last-chunk branch Mar 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.