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

nicolas-grekas
Copy link
Member

@nicolas-grekas 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 merged commit e11ef7e into symfony:master Mar 12, 2019
nicolas-grekas added a commit that referenced this pull request Mar 12, 2019
…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 hc-last-chunk branch March 15, 2019 13:41
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 Apr 30, 2019
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.

2 participants