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
The Javadocs of the generate methods as well the Emitter interface should explicitly mention that the methods should be called non-concurrently. Generate can be found in both Flowable and Observable.
generate:
<p>
Note that the {@link Emitter#onNext}, {@link Emitter#onError} and
{@link Emitter#onComplete} methods provided to the function should be called synchronously,
never concurrently and only while the method is executing. Calling them from multiple threads
or outside the function call is not supported and leads to an undefined behavior.
Emitter:
<p>
Note that the {@link Emitter#onNext}, {@link Emitter#onError} and
{@link Emitter#onComplete} methods provided to the function should be called synchronously,
never concurrently. Calling them from multiple threads is not supported and leads to an
undefined behavior.
The text was updated successfully, but these errors were encountered:
I believe calling from multiple threads is supported if there is a happens-before relationship between calls. Perhaps this:
<p>
Note that there must be a <i>happens-before</i> relationship between calls to the {@link Emitter#onNext}, {@link Emitter#onError} and
{@link Emitter#onComplete} methods. Calling those methods from multiple threads without establishing that relationship is not supported and leads to undefined behavior.
Fundamentally, the calls should not escape the callback method and one would have to block the callback if the onNext happens asynchronously to the method. Still you can only call it once and the blocking implicitly establishes this relationship.
The Javadocs of the
generate
methods as well theEmitter
interface should explicitly mention that the methods should be called non-concurrently. Generate can be found in bothFlowable
andObservable
.generate:
Emitter:
The text was updated successfully, but these errors were encountered: