[concurrency-interest] Clarifications request for Reactive Streams Specification Rule 1.1
viktor.klang at gmail.com
Thu Nov 2 13:58:34 EDT 2017
On Thu, Nov 2, 2017 at 5:49 PM, Pavel Rappo via Concurrency-interest <
concurrency-interest at cs.oswego.edu> wrote:
> I think this question is both about concurrency in Java and Reactive
> Thus posting it to a place where it could be seen by all interested
> > Rule #1.1
> > The total number of onNext's signalled by a Publisher to a Subscriber
> > be less than or equal to the total number of elements requested by
> > Subscriber's Subscription at all times.
> > The intent of this rule is to make it clear that Publishers cannot
> > more elements than Subscribers have requested. There’s an implicit,
> > important, consequence to this rule: Since demand can only be
> > after it has been received, there’s a happens-before relationship
> > requesting elements and receiving elements.
> It sounds like it is more about causality than happens-before.
Like if there is
> an Subscriber.onNext call in the execution, it must be that there was at
> least a
> single Subscription.request call in that execution earlier.
> If it is really about happens-before, the rule might benefit from the
> clarification ("concurrent collections" style):
> Actions in a thread prior to requesting an item from a Subscription
> happen-before actions subsequent to receiving of that item in
> Subscriber.onNext in another thread.
> However, since we don't know an element before we receive one in onNext,
> it can
> be quite tricky to formulate that clearly.
The Intent-section of the rule is not the specification of the rule. :)
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest