|
36 | 36 | import org.mockito.MockitoAnnotations; |
37 | 37 |
|
38 | 38 | import rx.observables.GroupedObservable; |
39 | | -import rx.operators.OperationConcat; |
40 | | -import rx.operators.OperationDefer; |
41 | | -import rx.operators.OperationDematerialize; |
42 | | -import rx.operators.OperationFilter; |
43 | | -import rx.operators.OperationMap; |
44 | | -import rx.operators.OperationMaterialize; |
45 | | -import rx.operators.OperationMerge; |
46 | | -import rx.operators.OperationMergeDelayError; |
47 | | -import rx.operators.OperationMostRecent; |
48 | | -import rx.operators.OperationNext; |
49 | | -import rx.operators.OperationOnErrorResumeNextViaFunction; |
50 | | -import rx.operators.OperationOnErrorResumeNextViaObservable; |
51 | | -import rx.operators.OperationOnErrorReturn; |
52 | | -import rx.operators.OperationScan; |
53 | | -import rx.operators.OperationSkip; |
54 | | -import rx.operators.OperationSynchronize; |
55 | | -import rx.operators.OperationTake; |
56 | | -import rx.operators.OperationTakeLast; |
57 | | -import rx.operators.OperationToObservableFuture; |
58 | | -import rx.operators.OperationToObservableIterable; |
59 | | -import rx.operators.OperationToObservableList; |
60 | | -import rx.operators.OperationToObservableSortedList; |
61 | | -import rx.operators.OperationZip; |
62 | | -import rx.operators.OperatorGroupBy; |
63 | | -import rx.operators.OperatorTakeUntil; |
64 | | -import rx.operators.OperatorToIterator; |
| 39 | +import rx.operators.*; |
65 | 40 | import rx.plugins.RxJavaErrorHandler; |
66 | 41 | import rx.plugins.RxJavaPlugins; |
67 | 42 | import rx.subscriptions.Subscriptions; |
@@ -766,6 +741,14 @@ public static Observable<Integer> range(int start, int count) { |
766 | 741 | return from(Range.createWithCount(start, count)); |
767 | 742 | } |
768 | 743 |
|
| 744 | + public static <T> Observable<T> subscribeOn(Observable<T> source, Scheduler scheduler) { |
| 745 | + return _create(OperationSubscribeOn.subscribeOn(source, scheduler)); |
| 746 | + } |
| 747 | + |
| 748 | + public static <T> Observable<T> observeOn(Observable<T> source, Scheduler scheduler) { |
| 749 | + return _create(OperationObserveOn.observeOn(source, scheduler)); |
| 750 | + } |
| 751 | + |
769 | 752 | /** |
770 | 753 | * Returns an observable sequence that invokes the observable factory whenever a new observer subscribes. |
771 | 754 | * The Defer operator allows you to defer or delay the creation of the sequence until the time when an observer |
@@ -2589,6 +2572,14 @@ public Observable<Notification<T>> materialize() { |
2589 | 2572 | return materialize(this); |
2590 | 2573 | } |
2591 | 2574 |
|
| 2575 | + public Observable<T> subscribeOn(Scheduler scheduler) { |
| 2576 | + return subscribeOn(this, scheduler); |
| 2577 | + } |
| 2578 | + |
| 2579 | + public Observable<T> observeOn(Scheduler scheduler) { |
| 2580 | + return observeOn(this, scheduler); |
| 2581 | + } |
| 2582 | + |
2592 | 2583 | /** |
2593 | 2584 | * Dematerializes the explicit notification values of an observable sequence as implicit notifications. |
2594 | 2585 | * |
|
0 commit comments