[concurrency-interest] JDK 9 Flow javadoc example SampleSubscriber requesting

Doug Lea dl at cs.oswego.edu
Sat Sep 24 12:23:08 EDT 2016

On 09/24/2016 10:08 AM, Dávid Karnok wrote:
> Given a synchronous end-consumer Flow.Subscriber of a Flow.Publisher, generally
> there is no reason to request in parts/batches and almost all should be able to
> request Long.MAX_VALUE at the beginning.

The UnboundedSubscriber code example shows this usage, prefaced with

"...when flow control is never needed, a subscriber may initially request an 
effectively unbounded number of items..."

Suggestions for improving that sentence would be welcome. But
I'm not sure we can/should say anything in top-level specs
about the situations in which "flow control is never needed".
Even some synchronous cases might use buffering.


More information about the Concurrency-interest mailing list