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
Hi
I'm trying to inject context(put to ThreadLocal) when subscribing with RxJavaPlugins#onXxxSubscribe to make each operation can access the context.
After running the test case, the Flowable runs correctly, but if I use Flowable#parallel, I think each subscribe doesn't use RxJavaPlugins.onSubscribe and I can't customize the subscriber.
Curious if it's intentioned, or for example, ParallelMap needs to like below in subscribe?
@Override
public void subscribe(Subscriber<? super R>[] subscribers) {
.....
for (int i = 0; i < n; i++) {
// wrap with hook here?
Subscriber<? super R> a = RxJavaPlugins.onSubscribe(this, subscribers[i]);
if (a instanceof ConditionalSubscriber) {
parents[i] = new ParallelMapConditionalSubscriber<T, R>((ConditionalSubscriber<? super R>)a, mapper);
} else {
parents[i] = new ParallelMapSubscriber<T, R>(a, mapper);
}
}
source.subscribe(parents);
}