@@ -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.<Event>fromEmitter(emitter -> {
1986- * Callback listener = new Callback() {
1987- * @Override
1988- * public void onEvent(Event e) {
1989- * emitter.onNext(e);
1990- * if (e.isLast()) {
1991- * emitter.onCompleted();
1992- * }
1993- * }
1994- *
1995- * @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.
0 commit comments