You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can the subscriber.onNext(item) be invoked before the subscriber.onSubscribe(subscription) returns, e.g. the subscriber invokes subscription.request(n) within the onSubscribe(subscription) method?
voidonSubscribe(Subscriptionsubscription) {
subscription.request(1);
// the publisher may start (asynchronously) publishing items to the subscriber// which means the onNext(item) may be invoked before this method returnslog.debug("end-of-on-subscribe");
}
voidonNext(Titem) {
log.debug("next");
}
(If logging is synchronized,)
Can next be logged before the end-of-on-subscribe?
The text was updated successfully, but these errors were encountered:
onacit
changed the title
Can onNext may be signaled with onSubscribe?
Can onNext may be signaled before onSubscribe returns?
Jan 14, 2024
onacit
changed the title
Can onNext may be signaled before onSubscribe returns?
Can onNext may be signalled before onSubscribe returns?
Jan 14, 2024
Rule §3.2 implies it is allowed. Rule §1.3 forbids overlapping concurrent invocation between onSubscribe and onNext. Thus synchronous invocation should be allowed in theory.
In practice, you may have to deferrequest calls happening while onSubscribe is running and reissue them after. Especially if you are mixing implementations from different vendors or your own.
Can the
subscriber.onNext(item)
be invoked before thesubscriber.onSubscribe(subscription)
returns, e.g. thesubscriber
invokessubscription.request(n)
within theonSubscribe(subscription)
method?(If logging is synchronized,)
Can
next
be logged before theend-of-on-subscribe
?The text was updated successfully, but these errors were encountered: