File tree 1 file changed +11
-1
lines changed
rxjava-reactive-streams/src/main/java/rx
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -55,9 +55,19 @@ public static <T> Observable<T> toObservable(final Publisher<T> publisher) {
55
55
return Observable .create (new Observable .OnSubscribe <T >() {
56
56
@ Override
57
57
public void call (final rx .Subscriber <? super T > rxSubscriber ) {
58
- publisher .subscribe (new SubscriberAdapter < T > (rxSubscriber ));
58
+ publisher .subscribe (toSubscriber (rxSubscriber ));
59
59
}
60
60
});
61
61
}
62
62
63
+ /**
64
+ * Convert an RxJava {@link rx.Subscriber} into a Reactive Streams {@link org.reactivestreams.Subscriber}.
65
+ *
66
+ * @param rxSubscriber an RxJava subscriber
67
+ * @return a Reactive Streams subscriber
68
+ */
69
+ public static <T > org .reactivestreams .Subscriber <T > toSubscriber (final rx .Subscriber <T > rxSubscriber ) {
70
+ return new SubscriberAdapter <T >(rxSubscriber );
71
+ }
72
+
63
73
}
You can’t perform that action at this time.
0 commit comments