RFR: 8252374: Add a new factory method to concatenate a sequence of BodyPublisher instances into a single publisher. [v6]
Daniel Fuchs
dfuchs at openjdk.java.net
Tue Oct 6 17:54:06 UTC 2020
On Mon, 5 Oct 2020 09:09:17 GMT, Chris Hegarty <chegar at openjdk.org> wrote:
>> Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Improved the API documentation of BodyPublishers::concat
>
> Changes requested by chegar (Reviewer).
@ChrisHegarty As we discussed I have fixed the handling of negative requests, and hooked the publishers created by the
new concat method to the TCK tests.
This made me realize that the `AggregateSubscription` should be checking its cancellation status more often to make it
sure it's reported as soon as possible to the upstream publishers. Similarly I updated the `PullPublisher` to check its
error state more often. The issue here is when the error/cancellation gets reported in the same thread in which the
sequential scheduler is running, and when the upstream publisher is busily forwarding items until its demand is
exhausted. If you had a single `request()` call with a high demand - then you do need to check the error/cancellation
state before forwarding the next item - and not only after/before each `request()` call to the upstream publisher.
I also tweaked `Demand` to generate an `IllegalArgumentException` message that contains the (optional) message string
expected by the TCK.
-------------
PR: https://git.openjdk.java.net/jdk/pull/57
More information about the net-dev
mailing list