Skip to content

Commit ccac9e7

Browse files
Merge pull request #1053 from benjchristensen/deprecation-cleanup
Deprecation Cleanup
2 parents d40c868 + e505cee commit ccac9e7

File tree

81 files changed

+141
-5919
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+141
-5919
lines changed

language-adaptors/rxjava-clojure/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,22 +106,22 @@ or, at the REPL:
106106
```
107107

108108
### Using rx/fn
109-
Once the namespace is required, you can use the `rx/fn` macro anywhere RxJava wants a `rx.util.functions.Func` object. The syntax is exactly the same as `clojure.core/fn`:
109+
Once the namespace is required, you can use the `rx/fn` macro anywhere RxJava wants a `rx.functions.Func` object. The syntax is exactly the same as `clojure.core/fn`:
110110

111111
```clojure
112112
(-> my-observable
113113
(.map (rx/fn [v] (* 2 v))))
114114
```
115115

116-
If you already have a plain old Clojure function you'd like to use, you can pass it to the `rx/fn*` function to get a new object that implements `rx.util.functions.Func`:
116+
If you already have a plain old Clojure function you'd like to use, you can pass it to the `rx/fn*` function to get a new object that implements `rx.functions.Func`:
117117

118118
```clojure
119119
(-> my-numbers
120120
(.reduce (rx/fn* +)))
121121
```
122122

123123
### Using rx/action
124-
The `rx/action` macro is identical to `rx/fn` except that the object returned implements `rx.util.functions.Action` interfaces. It's used in `subscribe` and other side-effect-y contexts:
124+
The `rx/action` macro is identical to `rx/fn` except that the object returned implements `rx.functions.Action` interfaces. It's used in `subscribe` and other side-effect-y contexts:
125125

126126
```clojure
127127
(-> my-observable
@@ -133,7 +133,7 @@ The `rx/action` macro is identical to `rx/fn` except that the object returned im
133133
```
134134

135135
### Using Observable/create
136-
As of 0.17, `rx.Observable/create` takes an implementation of `rx.Observable$OnSubscribe` which is basically an alias for `rx.util.functions.Action1` that takes an `rx.Subscriber` as its argument. Thus, you can just use `rx/action` when creating new observables:
136+
As of 0.17, `rx.Observable/create` takes an implementation of `rx.Observable$OnSubscribe` which is basically an alias for `rx.functions.Action1` that takes an `rx.Subscriber` as its argument. Thus, you can just use `rx/action` when creating new observables:
137137

138138
```clojure
139139
; A simple observable that emits 0..9 taking unsubscribe into account

language-adaptors/rxjava-clojure/src/main/clojure/rx/lang/clojure/chunk.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
(instance? rx.Observable action)
7474
(rx/on-next observer
7575
(.finallyDo ^rx.Observable action
76-
(reify rx.util.functions.Action0
76+
(reify rx.functions.Action0
7777
(call [this]
7878
(swap! state-atom update-in [:in-flight] disj action)
7979
(advance! state-atom)))))))

language-adaptors/rxjava-clojure/src/main/clojure/rx/lang/clojure/core.clj

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
BlockingObservable
2323
GroupedObservable]
2424
[rx.subscriptions Subscriptions]
25-
[rx.util.functions Action0 Action1 Func0 Func1 Func2]))
25+
[rx.functions Action0 Action1 Func0 Func1 Func2]))
2626

2727
(set! *warn-on-reflection* true)
2828

@@ -292,16 +292,14 @@
292292
;################################################################################
293293
; Operators
294294

295-
(defn synchronize
296-
"Synchronize execution.
295+
(defn serialize
296+
"Serialize execution.
297297
298298
See:
299-
rx.Observable/synchronize
299+
rx.Observable/serialize
300300
"
301301
([^Observable xs]
302-
(.synchronize xs))
303-
([lock ^Observable xs]
304-
(.synchronize xs lock)))
302+
(.serialize xs)))
305303

306304
(defn merge*
307305
"Merge an Observable of Observables into a single Observable
@@ -472,10 +470,10 @@
472470
empty Observable if xs is empty.
473471
474472
See:
475-
rx.Observable/takeFirst
473+
rx.Observable/take(1)
476474
"
477475
[^Observable xs]
478-
(.takeFirst xs))
476+
(.take xs 1))
479477

480478
(defn ^Observable group-by
481479
"Returns an Observable of clojure.lang.MapEntry where the key is the result of
@@ -832,7 +830,7 @@
832830
833831
See:
834832
rx.Observable/onErrorResumeNext
835-
http://netflix.github.io/RxJava/javadoc/rx/Observable.html#onErrorResumeNext(rx.util.functions.Func1)
833+
http://netflix.github.io/RxJava/javadoc/rx/Observable.html#onErrorResumeNext(rx.functions.Func1)
836834
"
837835
[p f ^Observable o]
838836
(let [p (if (class? p)

language-adaptors/rxjava-clojure/src/test/clojure/rx/lang/clojure/core_test.clj

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,14 @@
9696
(b/into []))]
9797
(is (= [2 4] result))))
9898

99-
(deftest test-syncrhonize
100-
; I'm going to believe synchronize works and just exercise it
99+
(deftest test-serialize
100+
; I'm going to believe serialize works and just exercise it
101101
; here for sanity.
102102
(is (= [1 2 3]
103103
(->> [1 2 3]
104104
(rx/seq->o)
105-
(rx/synchronize)
106-
(b/into []))))
107-
(let [lock (Object.)]
108-
(is (= [1 2 3]
109-
(->> [1 2 3]
110-
(rx/seq->o)
111-
(rx/synchronize lock)
112-
(b/into []))))))
105+
(rx/serialize)
106+
(b/into [])))))
113107

114108
(let [expected-result [[1 3 5] [2 4 6]]
115109
sleepy-o #(f/future-generator*

language-adaptors/rxjava-groovy/src/test/groovy/rx/lang/groovy/ObservableTests.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def class ObservableTests {
322322

323323
Observable.from("one", "two", "three", "four", "five", "six")
324324
.groupBy({String s -> s.length()})
325-
.mapMany({
325+
.flatMap({
326326
groupObservable ->
327327

328328
return groupObservable.map({

language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/Observable.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ trait Observable[+T]
268268
* @return an Observable that is a chronologically well-behaved version of the source
269269
* Observable, and that synchronously notifies its [[rx.lang.scala.Observer]]s
270270
*/
271-
def synchronize: Observable[T] = {
272-
toScalaObservable[T](asJavaObservable.synchronize)
271+
def serialize: Observable[T] = {
272+
toScalaObservable[T](asJavaObservable.serialize)
273273
}
274274

275275
/**

rxjava-contrib/rxjava-quasar/src/main/java/rx/quasar/BlockingObservable.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@
1515
*/
1616
package rx.quasar;
1717

18-
import co.paralleluniverse.fibers.SuspendExecution;
19-
import co.paralleluniverse.fibers.Suspendable;
20-
import co.paralleluniverse.strands.AbstractFuture;
21-
import co.paralleluniverse.strands.ConditionSynchronizer;
22-
import co.paralleluniverse.strands.SimpleConditionSynchronizer;
23-
import co.paralleluniverse.strands.Strand;
24-
import co.paralleluniverse.strands.channels.Channels;
25-
import co.paralleluniverse.strands.channels.DelegatingReceivePort;
26-
import co.paralleluniverse.strands.channels.ProducerException;
27-
import co.paralleluniverse.strands.channels.ReceivePort;
2818
import java.util.concurrent.Future;
2919
import java.util.concurrent.TimeUnit;
3020
import java.util.concurrent.atomic.AtomicBoolean;
@@ -38,6 +28,16 @@
3828
import rx.functions.Action1;
3929
import rx.functions.Func1;
4030
import rx.observers.SafeSubscriber;
31+
import co.paralleluniverse.fibers.SuspendExecution;
32+
import co.paralleluniverse.fibers.Suspendable;
33+
import co.paralleluniverse.strands.AbstractFuture;
34+
import co.paralleluniverse.strands.ConditionSynchronizer;
35+
import co.paralleluniverse.strands.SimpleConditionSynchronizer;
36+
import co.paralleluniverse.strands.Strand;
37+
import co.paralleluniverse.strands.channels.Channels;
38+
import co.paralleluniverse.strands.channels.DelegatingReceivePort;
39+
import co.paralleluniverse.strands.channels.ProducerException;
40+
import co.paralleluniverse.strands.channels.ReceivePort;
4141

4242
/**
4343
* An extension of {@link Observable} that provides blocking operators, compatible with both threads and fibers.

rxjava-contrib/rxjava-quasar/src/main/java/rx/quasar/ChannelObservable.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
* limitations under the License.
1515
*/package rx.quasar;
1616

17+
import java.util.concurrent.ExecutionException;
18+
import java.util.concurrent.TimeUnit;
19+
import java.util.concurrent.TimeoutException;
20+
21+
import rx.Observable;
22+
import rx.Observer;
23+
import rx.Scheduler;
1724
import co.paralleluniverse.fibers.FiberAsync;
1825
import co.paralleluniverse.fibers.SuspendExecution;
1926
import co.paralleluniverse.fibers.Suspendable;
@@ -22,12 +29,6 @@
2229
import co.paralleluniverse.strands.channels.Channels;
2330
import co.paralleluniverse.strands.channels.ReceivePort;
2431
import co.paralleluniverse.strands.channels.SendPort;
25-
import java.util.concurrent.ExecutionException;
26-
import java.util.concurrent.TimeUnit;
27-
import java.util.concurrent.TimeoutException;
28-
import rx.Observable;
29-
import rx.Observer;
30-
import rx.Scheduler;
3132

3233
/**
3334
* This class contains static methods that connect {@link Observable}s and {@link Channel}s.

rxjava-contrib/rxjava-quasar/src/main/java/rx/quasar/NewFiberScheduler.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,19 @@
1515
*/
1616
package rx.quasar;
1717

18-
import co.paralleluniverse.fibers.DefaultFiberScheduler;
19-
import co.paralleluniverse.fibers.Fiber;
20-
import co.paralleluniverse.fibers.FiberScheduler;
21-
import co.paralleluniverse.fibers.SuspendExecution;
22-
import co.paralleluniverse.strands.SuspendableRunnable;
23-
2418
import java.util.concurrent.TimeUnit;
2519
import java.util.concurrent.atomic.AtomicReference;
2620

2721
import rx.Scheduler;
2822
import rx.Subscription;
23+
import rx.functions.Action0;
2924
import rx.subscriptions.CompositeSubscription;
3025
import rx.subscriptions.Subscriptions;
31-
import rx.functions.Action0;
26+
import co.paralleluniverse.fibers.DefaultFiberScheduler;
27+
import co.paralleluniverse.fibers.Fiber;
28+
import co.paralleluniverse.fibers.FiberScheduler;
29+
import co.paralleluniverse.fibers.SuspendExecution;
30+
import co.paralleluniverse.strands.SuspendableRunnable;
3231

3332
/**
3433
* Schedules work on a new fiber.

rxjava-contrib/rxjava-quasar/src/main/java/rx/quasar/OnSubscribeFromChannel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
*/
1616
package rx.quasar;
1717

18-
import co.paralleluniverse.fibers.Suspendable;
19-
import co.paralleluniverse.strands.channels.ReceivePort;
2018
import rx.Observable.OnSubscribe;
2119
import rx.Subscriber;
20+
import co.paralleluniverse.fibers.Suspendable;
21+
import co.paralleluniverse.strands.channels.ReceivePort;
2222

2323
/**
2424
* Converts a {@link ReceivePort} into an Observable that emits each message received on the channel.

0 commit comments

Comments
 (0)