Skip to content

Commit 40be93b

Browse files
Use Action instead of Func0<Void>
As per ReactiveX#1899 (comment)
1 parent c4265fc commit 40be93b

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/main/java/rx/internal/operators/OperatorOnBackpressureBuffer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
import rx.Observable.Operator;
2525
import rx.Producer;
2626
import rx.Subscriber;
27-
import rx.functions.Func0;
27+
import rx.functions.Action0;
2828

2929
public class OperatorOnBackpressureBuffer<T> implements Operator<T, T> {
3030

3131
private final NotificationLite<T> on = NotificationLite.instance();
3232

3333
private final Long capacity;
34-
private final Func0 onOverflow;
34+
private final Action0 onOverflow;
3535

3636
public OperatorOnBackpressureBuffer() {
3737
this.capacity = null;
@@ -42,7 +42,7 @@ public OperatorOnBackpressureBuffer(long capacity) {
4242
this(capacity, null);
4343
}
4444

45-
public OperatorOnBackpressureBuffer(long capacity, Func0<Void> onOverflow) {
45+
public OperatorOnBackpressureBuffer(long capacity, Action0 onOverflow) {
4646
if (capacity <= 0) {
4747
throw new IllegalArgumentException("Buffer capacity must be > 0");
4848
}

src/test/java/rx/internal/operators/OperatorOnBackpressureBufferTest.java

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

18+
import static org.junit.Assert.assertEquals;
19+
import static org.junit.Assert.assertTrue;
20+
1821
import java.nio.BufferOverflowException;
1922
import java.util.concurrent.CountDownLatch;
2023

@@ -25,14 +28,11 @@
2528
import rx.Observer;
2629
import rx.Subscriber;
2730
import rx.Subscription;
28-
import rx.functions.Func0;
31+
import rx.functions.Action0;
2932
import rx.observables.ConnectableObservable;
3033
import rx.observers.TestSubscriber;
3134
import rx.schedulers.Schedulers;
3235

33-
import static org.junit.Assert.assertEquals;
34-
import static org.junit.Assert.assertTrue;
35-
3636
public class OperatorOnBackpressureBufferTest {
3737

3838
@Test
@@ -126,11 +126,10 @@ public void onNext(Long t) {
126126
.publish();
127127
final ConnectableObservable<Long> batch =
128128
infinite.subscribeOn(Schedulers.computation())
129-
.onBackpressureBuffer(100, new Func0<Void>() {
129+
.onBackpressureBuffer(100, new Action0() {
130130
@Override
131-
public Void call() {
131+
public void call() {
132132
l3.countDown();
133-
return null;
134133
}
135134
}).publish();
136135
Subscription s = batch.subscribe(ts);

0 commit comments

Comments
 (0)