Skip to content

Commit cd4c1ac

Browse files
Remove deprecated rx.util.functions.*
- organized imports and fixed few places that were still accidentally using the old package
1 parent d40c868 commit cd4c1ac

Some content is hidden

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

48 files changed

+84
-1505
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: 2 additions & 2 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

@@ -832,7 +832,7 @@
832832
833833
See:
834834
rx.Observable/onErrorResumeNext
835-
http://netflix.github.io/RxJava/javadoc/rx/Observable.html#onErrorResumeNext(rx.util.functions.Func1)
835+
http://netflix.github.io/RxJava/javadoc/rx/Observable.html#onErrorResumeNext(rx.functions.Func1)
836836
"
837837
[p f ^Observable o]
838838
(let [p (if (class? p)

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.

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

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

18-
import co.paralleluniverse.fibers.instrument.MethodDatabase;
19-
import co.paralleluniverse.fibers.instrument.SimpleSuspendableClassifier;
20-
import co.paralleluniverse.fibers.instrument.SuspendableClassifier;
2118
import java.util.Arrays;
2219
import java.util.HashSet;
2320
import java.util.Set;
2421

22+
import co.paralleluniverse.fibers.instrument.MethodDatabase;
23+
import co.paralleluniverse.fibers.instrument.SimpleSuspendableClassifier;
24+
import co.paralleluniverse.fibers.instrument.SuspendableClassifier;
25+
2526
public class RxSuspendableClassifier implements SuspendableClassifier {
2627
private static final Set<String> CORE_PACKAGES = new HashSet<String>(Arrays.asList(new String[]{
2728
"rx", "rx.joins", "rx.observables", "rx.observers", "rx.operators", "rx.plugins", "rx.schedulers",

rxjava-contrib/rxjava-quasar/src/test/java/rx/quasar/BlockingObservableTest.java

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

18-
import co.paralleluniverse.strands.channels.ProducerException;
19-
import co.paralleluniverse.strands.channels.ReceivePort;
20-
import static org.junit.Assert.*;
21-
22-
import java.util.Iterator;
23-
import java.util.NoSuchElementException;
18+
import static org.junit.Assert.assertEquals;
19+
import static org.junit.Assert.fail;
2420

2521
import org.junit.Assert;
2622
import org.junit.Before;
@@ -32,10 +28,12 @@
3228
import rx.Observer;
3329
import rx.Subscriber;
3430
import rx.Subscription;
31+
import rx.functions.Action1;
32+
import rx.functions.Func1;
3533
import rx.subscriptions.BooleanSubscription;
3634
import rx.subscriptions.Subscriptions;
37-
import rx.util.functions.Action1;
38-
import rx.util.functions.Func1;
35+
import co.paralleluniverse.strands.channels.ProducerException;
36+
import co.paralleluniverse.strands.channels.ReceivePort;
3937

4038
public class BlockingObservableTest {
4139

rxjava-contrib/rxjava-quasar/src/test/java/rx/quasar/ChannelObservableTest.java

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

18-
import co.paralleluniverse.fibers.Fiber;
19-
import co.paralleluniverse.fibers.SuspendExecution;
20-
import co.paralleluniverse.fibers.Suspendable;
21-
import co.paralleluniverse.strands.Strand;
22-
import co.paralleluniverse.strands.SuspendableCallable;
23-
import co.paralleluniverse.strands.channels.Channel;
24-
import co.paralleluniverse.strands.channels.Channels;
25-
import co.paralleluniverse.strands.channels.ProducerException;
26-
import co.paralleluniverse.strands.channels.ReceivePort;
18+
import static org.hamcrest.CoreMatchers.equalTo;
19+
import static org.hamcrest.CoreMatchers.instanceOf;
20+
import static org.hamcrest.CoreMatchers.is;
21+
import static org.hamcrest.CoreMatchers.nullValue;
22+
import static org.junit.Assert.assertThat;
23+
import static org.junit.Assert.assertTrue;
24+
import static org.junit.Assert.fail;
25+
2726
import java.util.ArrayList;
2827
import java.util.Arrays;
2928
import java.util.Queue;
3029
import java.util.concurrent.ConcurrentLinkedQueue;
3130
import java.util.concurrent.ExecutionException;
3231
import java.util.concurrent.atomic.AtomicBoolean;
33-
import static org.hamcrest.CoreMatchers.*;
34-
import static org.junit.Assert.*;
32+
3533
import org.junit.Test;
34+
3635
import rx.Observable;
3736
import rx.Observer;
3837
import rx.subjects.PublishSubject;
38+
import co.paralleluniverse.fibers.Fiber;
39+
import co.paralleluniverse.fibers.SuspendExecution;
40+
import co.paralleluniverse.fibers.Suspendable;
41+
import co.paralleluniverse.strands.Strand;
42+
import co.paralleluniverse.strands.SuspendableCallable;
43+
import co.paralleluniverse.strands.channels.Channel;
44+
import co.paralleluniverse.strands.channels.Channels;
45+
import co.paralleluniverse.strands.channels.ProducerException;
46+
import co.paralleluniverse.strands.channels.ReceivePort;
3947

4048
public class ChannelObservableTest {
4149
@Test

0 commit comments

Comments
 (0)