@@ -18,13 +18,6 @@ package rx.lang
18
18
import java .util .concurrent .TimeUnit
19
19
import java .util .Date
20
20
21
- /*
22
- * Note that:
23
- * - Scala users cannot use Java's types with variance without always using writing
24
- * e.g. rx.Notification[_ <: T], so we create aliases fixing the variance
25
- * - For consistency, we create aliases for all types which Scala users need
26
- */
27
-
28
21
/**
29
22
* This package contains all classes that RxScala users need.
30
23
*
@@ -33,95 +26,6 @@ import java.util.Date
33
26
*/
34
27
package object scala {
35
28
36
- /*
37
- * Here we're imitating C's preprocessor using Search & Replace.
38
- *
39
- * To activate the code needed to get nice Scaladoc, do the following replacements:
40
- * /* //#ifdef SCALADOC --> //#ifdef SCALADOC
41
- * */ //#else --> /* //#else
42
- * //#endif --> */ //#endif
43
- *
44
- * To get back to the actual code, undo the above replacements.
45
- *
46
- */
47
-
48
- /* //#ifdef SCALADOC
49
-
50
- /**
51
- * Provides a mechanism for receiving push-based notifications.
52
- *
53
- * After an Observer calls an [[Observable ]]'s `subscribe` method, the Observable
54
- * calls the Observer's `onNext` method to provide notifications. A well-behaved Observable will
55
- * call an Observer's `onCompleted` method exactly once or the Observer's `onError` method exactly once.
56
- */
57
- trait Observer[-T] {
58
-
59
- /**
60
- * Notifies the Observer that the [[Observable ]] has finished sending push-based notifications.
61
- *
62
- * The [[Observable ]] will not call this method if it calls `onError`.
63
- */
64
- def onCompleted(): Unit
65
-
66
- /**
67
- * Notifies the Observer that the [[Observable ]] has experienced an error condition.
68
- *
69
- * If the [[Observable ]] calls this method, it will not thereafter call `onNext` or `onCompleted`.
70
- */
71
- def onError(e: Throwable): Unit
72
-
73
- /**
74
- * Provides the Observer with new data.
75
- *
76
- * The [[Observable ]] calls this closure 0 or more times.
77
- *
78
- * The [[Observable ]] will not call this method again after it calls either `onCompleted` or `onError`.
79
- */
80
- def onNext(arg: T): Unit
81
- }
82
-
83
- /**
84
- * Subscriptions are returned from all `Observable.subscribe` methods to allow unsubscribing.
85
- *
86
- * This interface is the equivalent of `IDisposable` in the .NET Rx implementation.
87
- */
88
- trait Subscription {
89
- /**
90
- * Call this method to stop receiving notifications on the Observer that was registered when
91
- * this Subscription was received.
92
- */
93
- def unsubscribe(): Unit
94
- }
95
-
96
- import language.implicitConversions
97
-
98
- private[scala] implicit def fakeSubscription2RxSubscription(s: Subscription): rx.Subscription =
99
- new rx.Subscription {
100
- def unsubscribe() = s.unsubscribe()
101
- }
102
- private[scala] implicit def rxSubscription2FakeSubscription(s: rx.Subscription): Subscription =
103
- new Subscription {
104
- def unsubscribe() = s.unsubscribe()
105
- }
106
-
107
- private[scala] implicit def schedulerActionToFunc2[T](action: (Scheduler, T) => Subscription) =
108
- new rx.util.functions.Func2[rx.Scheduler, T, rx.Subscription] {
109
- def call(s: rx.Scheduler, t: T): rx.Subscription = {
110
- action(ImplicitFunctionConversions.javaSchedulerToScalaScheduler(s), t)
111
- }
112
- }
113
-
114
- private[scala] implicit def fakeObserver2RxObserver[T](o: Observer[T]): rx.Observer[_ >: T] = ???
115
- private[scala] implicit def rxObserver2fakeObserver[T](o: rx.Observer[_ >: T]): Observer[T] = ???
116
-
117
- */ // #else
118
-
119
- type Observer [- T ] = rx.Observer [_ >: T ]
120
-
121
- type Subscription = rx.Subscription
122
-
123
- // #endif
124
-
125
29
/**
126
30
* Allows to construct observables in a similar way as futures.
127
31
*
@@ -142,17 +46,3 @@ package object scala {
142
46
Observable (1 ).observeOn(scheduler).map(_ => body)
143
47
}
144
48
}
145
-
146
- /*
147
-
148
- These classes are considered unnecessary for Scala users, so we don't create aliases for them:
149
-
150
- rx.plugins.RxJavaErrorHandler
151
- rx.plugins.RxJavaObservableExecutionHook
152
- rx.plugins.RxJavaPlugins
153
-
154
- rx.subscriptions.BooleanSubscription
155
- rx.subscriptions.CompositeSubscription
156
- rx.subscriptions.Subscriptions
157
-
158
- */
0 commit comments