Skip to content

Commit 1f65cbb

Browse files
davidmotenakarnokd
authored andcommitted
remove AsyncEmitter deprecations (#4725)
1 parent 6cc1646 commit 1f65cbb

File tree

7 files changed

+7
-1530
lines changed

7 files changed

+7
-1530
lines changed

src/main/java/rx/AsyncEmitter.java

Lines changed: 0 additions & 99 deletions
This file was deleted.

src/main/java/rx/CompletableEmitter.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616
package rx;
1717

18-
import rx.AsyncEmitter.Cancellable;
1918
import rx.annotations.Experimental;
19+
import rx.functions.Cancellable;
2020

2121
/**
2222
* Abstraction over a {@link CompletableSubscriber} that gets either an onCompleted or onError
@@ -25,10 +25,8 @@
2525
* All methods are thread-safe; calling onCompleted or onError twice or one after the other has
2626
* no effect.
2727
* @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
28-
* @deprecated as of 1.2.1 because `setCancellation` method will change signature (not name) for 1.2.2.
2928
*/
3029
@Experimental
31-
@Deprecated
3230
public interface CompletableEmitter {
3331

3432
/**

src/main/java/rx/Observable.java

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,55 +1976,6 @@ public static <T> Observable<T> from(T[] array) {
19761976
return create(new OnSubscribeFromArray<T>(array));
19771977
}
19781978

1979-
/**
1980-
* Provides an API (via a cold Observable) that bridges the reactive world with the callback-style,
1981-
* generally non-backpressured world.
1982-
* <p>
1983-
* Example:
1984-
* <pre><code>
1985-
* Observable.&lt;Event&gt;fromEmitter(emitter -&gt; {
1986-
* Callback listener = new Callback() {
1987-
* &#64;Override
1988-
* public void onEvent(Event e) {
1989-
* emitter.onNext(e);
1990-
* if (e.isLast()) {
1991-
* emitter.onCompleted();
1992-
* }
1993-
* }
1994-
*
1995-
* &#64;Override
1996-
* public void onFailure(Exception e) {
1997-
* emitter.onError(e);
1998-
* }
1999-
* };
2000-
*
2001-
* AutoCloseable c = api.someMethod(listener);
2002-
*
2003-
* emitter.setCancellation(c::close);
2004-
*
2005-
* }, BackpressureMode.BUFFER);
2006-
* </code></pre>
2007-
* <p>
2008-
* You should call the AsyncEmitter's onNext, onError and onCompleted methods in a serialized fashion. The
2009-
* rest of its methods are thread-safe.
2010-
*
2011-
* @param <T> the element type
2012-
* @param emitter the emitter that is called when a Subscriber subscribes to the returned {@code Observable}
2013-
* @param backpressure the backpressure mode to apply if the downstream Subscriber doesn't request (fast) enough
2014-
* @return the new Observable instance
2015-
* @see AsyncEmitter
2016-
* @see AsyncEmitter.BackpressureMode
2017-
* @see AsyncEmitter.Cancellable
2018-
* @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
2019-
* @deprecated since 1.2.1 because Async prefix of AsyncEmitter class is potentially misleading. Use
2020-
* {@link #fromEmitter(Action1, Emitter.BackpressureMode)} instead.
2021-
*/
2022-
@Experimental
2023-
@Deprecated
2024-
public static <T> Observable<T> fromEmitter(Action1<AsyncEmitter<T>> emitter, AsyncEmitter.BackpressureMode backpressure) {
2025-
return create(new OnSubscribeFromAsyncEmitter<T>(emitter, backpressure));
2026-
}
2027-
20281979
/**
20291980
* Provides an API (via a cold Observable) that bridges the reactive world with the callback-style,
20301981
* generally non-backpressured world.

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,16 @@
1818
import java.util.concurrent.atomic.AtomicBoolean;
1919

2020
import rx.*;
21-
import rx.AsyncEmitter.Cancellable;
2221
import rx.exceptions.Exceptions;
2322
import rx.functions.Action1;
24-
import rx.internal.operators.OnSubscribeFromAsyncEmitter.CancellableSubscription;
23+
import rx.functions.Cancellable;
24+
import rx.internal.operators.OnSubscribeFromEmitter.CancellableSubscription;
2525
import rx.internal.subscriptions.SequentialSubscription;
2626
import rx.plugins.RxJavaHooks;
2727

2828
/**
2929
* Allows push-based emission of terminal events to a CompletableSubscriber.
3030
*/
31-
@SuppressWarnings("deprecation")
3231
public final class CompletableFromEmitter implements Completable.OnSubscribe {
3332

3433
final Action1<CompletableEmitter> producer;

0 commit comments

Comments
 (0)