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

SingleConcatWithPublisher and invalid request-n #1042

Merged
merged 1 commit into from
May 6, 2020

Conversation

NiteshKant
Copy link
Collaborator

Motivation

If invalid calls to request-n are made for Single.concat(Publisher) before the Single result is propagated, we first emit the result and then propagate the invalid demand.
For cases, when the concatenated Publisher completes inline with subscribe()`` (eg: Publisher.empty()`), this means we will never deliver an error for the invalid demand.

Modification

Deliver error when invalid demand is made in the above case instead of Single's result and do not subscribe to the concatenated Publisher

Result

Invalid demand always terminates the Subscriber with an error.

@NiteshKant NiteshKant requested a review from Scottmitch May 6, 2020 00:23
@Scottmitch
Copy link
Member

`subscribe()``

@NiteshKant - The commit message has an extra back-tick which is confusing the markdown parsing.

__Motivation__

If invalid calls to request-n are made for `Single.concat(Publisher)` before the `Single` result is propagated, we first emit the result and then propagate the invalid demand.
For cases, when the concatenated `Publisher` completes inline with `subscribe()` (eg: `Publisher.empty()`), this means we will never deliver an error for the invalid demand.

__Modification__

Deliver error when invalid demand is made in the above case instead of `Single`'s result and do not subscribe to the concatenated `Publisher`

__Result__

Invalid demand always terminates the `Subscriber` with an error.
@NiteshKant NiteshKant merged commit 44161eb into apple:master May 6, 2020
@NiteshKant NiteshKant deleted the single-concat branch May 6, 2020 17:54
NiteshKant pushed a commit to NiteshKant/servicetalk that referenced this pull request May 6, 2020
__Motivation__

If invalid calls to request-n are made for `Single.concat(Publisher)` before the `Single` result is propagated, we first emit the result and then propagate the invalid demand.
For cases, when the concatenated `Publisher` completes inline with `subscribe()` (eg: `Publisher.empty()`), this means we will never deliver an error for the invalid demand.

__Modification__

Deliver error when invalid demand is made in the above case instead of `Single`'s result and do not subscribe to the concatenated `Publisher`

__Result__

Invalid demand always terminates the `Subscriber` with an error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants