Skip to content

Commit

Permalink
2.x: Apply promotions for v2.1 (#5307)
Browse files Browse the repository at this point in the history
  • Loading branch information
akarnokd authored Apr 21, 2017
1 parent 475c058 commit 2d20a17
Show file tree
Hide file tree
Showing 22 changed files with 141 additions and 484 deletions.
12 changes: 6 additions & 6 deletions src/main/java/io/reactivex/Completable.java
Original file line number Diff line number Diff line change
Expand Up @@ -986,12 +986,12 @@ public final Throwable blockingGet(long timeout, TimeUnit unit) {
* <dt><b>Scheduler:</b></dt>
* <dd>{@code cache} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* <p>History: 2.0.4 - experimental
* @return the new Completable instance
* @since 2.0.4 - experimental
* @since 2.1
*/
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@Experimental
public final Completable cache() {
return RxJavaPlugins.onAssembly(new CompletableCache(this));
}
Expand Down Expand Up @@ -1262,13 +1262,13 @@ public final Completable doAfterTerminate(final Action onAfterTerminate) {
* <dt><b>Scheduler:</b></dt>
* <dd>{@code doFinally} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* <p>History: 2.0.1 - experimental
* @param onFinally the action called when this Completable terminates or gets cancelled
* @return the new Completable instance
* @since 2.0.1 - experimental
* @since 2.1
*/
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@Experimental
public final Completable doFinally(Action onFinally) {
ObjectHelper.requireNonNull(onFinally, "onFinally is null");
return RxJavaPlugins.onAssembly(new CompletableDoFinally(this, onFinally));
Expand Down Expand Up @@ -1598,10 +1598,10 @@ public final <T> Flowable<T> startWith(Publisher<T> other) {
* <dt><b>Scheduler:</b></dt>
* <dd>{@code hide} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* <p>History: 2.0.5 - experimental
* @return the new Completable instance
* @since 2.0.5 - experimental
* @since 2.1
*/
@Experimental
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Completable hide() {
Expand Down
71 changes: 22 additions & 49 deletions src/main/java/io/reactivex/Flowable.java
Original file line number Diff line number Diff line change
Expand Up @@ -7648,14 +7648,14 @@ public final Flowable<T> distinctUntilChanged(BiPredicate<? super T, ? super T>
* <dd>This operator supports normal and conditional Subscribers as well as boundary-limited
* synchronous or asynchronous queue-fusion.</dd>
* </dl>
* <p>History: 2.0.1 - experimental
* @param onFinally the action called when this Flowable terminates or gets cancelled
* @return the new Flowable instance
* @since 2.0.1 - experimental
* @since 2.1
*/
@CheckReturnValue
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport(SchedulerSupport.NONE)
@Experimental
public final Flowable<T> doFinally(Action onFinally) {
ObjectHelper.requireNonNull(onFinally, "onFinally is null");
return RxJavaPlugins.onAssembly(new FlowableDoFinally<T>(this, onFinally));
Expand All @@ -7675,14 +7675,14 @@ public final Flowable<T> doFinally(Action onFinally) {
* <dd>This operator supports normal and conditional Subscribers as well as boundary-limited
* synchronous or asynchronous queue-fusion.</dd>
* </dl>
* <p>History: 2.0.1 - experimental
* @param onAfterNext the Consumer that will be called after emitting an item from upstream to the downstream
* @return the new Flowable instance
* @since 2.0.1 - experimental
* @since 2.1
*/
@CheckReturnValue
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport(SchedulerSupport.NONE)
@Experimental
public final Flowable<T> doAfterNext(Consumer<? super T> onAfterNext) {
ObjectHelper.requireNonNull(onAfterNext, "onAfterNext is null");
return RxJavaPlugins.onAssembly(new FlowableDoAfterNext<T>(this, onAfterNext));
Expand Down Expand Up @@ -10447,13 +10447,14 @@ public final Flowable<T> onTerminateDetach() {
* <dt><b>Scheduler:</b></dt>
* <dd>{@code parallel} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* <p>History: 2.0.5 - experimental
* @return the new ParallelFlowable instance
* @since 2.0.5 - experimental
* @since 2.1 - beta
*/
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
@CheckReturnValue
@Experimental
@Beta
public final ParallelFlowable<T> parallel() {
return ParallelFlowable.from(this);
}
Expand All @@ -10476,14 +10477,15 @@ public final ParallelFlowable<T> parallel() {
* <dt><b>Scheduler:</b></dt>
* <dd>{@code parallel} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* <p>History: 2.0.5 - experimental
* @param parallelism the number of 'rails' to use
* @return the new ParallelFlowable instance
* @since 2.0.5 - experimental
* @since 2.1 - beta
*/
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
@CheckReturnValue
@Experimental
@Beta
public final ParallelFlowable<T> parallel(int parallelism) {
ObjectHelper.verifyPositive(parallelism, "parallelism");
return ParallelFlowable.from(this, parallelism);
Expand All @@ -10508,15 +10510,16 @@ public final ParallelFlowable<T> parallel(int parallelism) {
* <dt><b>Scheduler:</b></dt>
* <dd>{@code parallel} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* <p>History: 2.0.5 - experimental
* @param parallelism the number of 'rails' to use
* @param prefetch the number of items each 'rail' should prefetch
* @return the new ParallelFlowable instance
* @since 2.0.5 - experimental
* @since 2.1 - beta
*/
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
@CheckReturnValue
@Experimental
@Beta
public final ParallelFlowable<T> parallel(int parallelism, int prefetch) {
ObjectHelper.verifyPositive(parallelism, "parallelism");
ObjectHelper.verifyPositive(prefetch, "prefetch");
Expand Down Expand Up @@ -11787,6 +11790,7 @@ public final Flowable<T> sample(long period, TimeUnit unit) {
* <dd>{@code sample} operates by default on the {@code computation} {@link Scheduler}.</dd>
* </dl>
*
* <p>History: 2.0.5 - experimental
* @param period
* the sampling rate
* @param unit
Expand All @@ -11800,12 +11804,11 @@ public final Flowable<T> sample(long period, TimeUnit unit) {
* @see <a href="http://reactivex.io/documentation/operators/sample.html">ReactiveX operators documentation: Sample</a>
* @see <a href="https://github.com/ReactiveX/RxJava/wiki/Backpressure">RxJava wiki: Backpressure</a>
* @see #throttleLast(long, TimeUnit)
* @since 2.0.5 - experimental
* @since 2.1
*/
@CheckReturnValue
@BackpressureSupport(BackpressureKind.ERROR)
@SchedulerSupport(SchedulerSupport.COMPUTATION)
@Experimental
public final Flowable<T> sample(long period, TimeUnit unit, boolean emitLast) {
return sample(period, unit, Schedulers.computation(), emitLast);
}
Expand Down Expand Up @@ -11856,6 +11859,7 @@ public final Flowable<T> sample(long period, TimeUnit unit, Scheduler scheduler)
* <dd>You specify which {@link Scheduler} this operator will use</dd>
* </dl>
*
* <p>History: 2.0.5 - experimental
* @param period
* the sampling rate
* @param unit
Expand All @@ -11871,12 +11875,11 @@ public final Flowable<T> sample(long period, TimeUnit unit, Scheduler scheduler)
* @see <a href="http://reactivex.io/documentation/operators/sample.html">ReactiveX operators documentation: Sample</a>
* @see <a href="https://github.com/ReactiveX/RxJava/wiki/Backpressure">RxJava wiki: Backpressure</a>
* @see #throttleLast(long, TimeUnit, Scheduler)
* @since 2.0.5 - experimental
* @since 2.1
*/
@CheckReturnValue
@BackpressureSupport(BackpressureKind.ERROR)
@SchedulerSupport(SchedulerSupport.CUSTOM)
@Experimental
public final Flowable<T> sample(long period, TimeUnit unit, Scheduler scheduler, boolean emitLast) {
ObjectHelper.requireNonNull(unit, "unit is null");
ObjectHelper.requireNonNull(scheduler, "scheduler is null");
Expand Down Expand Up @@ -11928,6 +11931,7 @@ public final <U> Flowable<T> sample(Publisher<U> sampler) {
* <dd>This version of {@code sample} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
*
* <p>History: 2.0.5 - experimental
* @param <U> the element type of the sampler Publisher
* @param sampler
* the Publisher to use for sampling the source Publisher
Expand All @@ -11939,12 +11943,11 @@ public final <U> Flowable<T> sample(Publisher<U> sampler) {
* the {@code sampler} Publisher emits an item or completes
* @see <a href="http://reactivex.io/documentation/operators/sample.html">ReactiveX operators documentation: Sample</a>
* @see <a href="https://github.com/ReactiveX/RxJava/wiki/Backpressure">RxJava wiki: Backpressure</a>
* @since 2.0.5 - experimental
* @since 2.1
*/
@CheckReturnValue
@BackpressureSupport(BackpressureKind.ERROR)
@SchedulerSupport(SchedulerSupport.NONE)
@Experimental
public final <U> Flowable<T> sample(Publisher<U> sampler, boolean emitLast) {
ObjectHelper.requireNonNull(sampler, "sampler is null");
return RxJavaPlugins.onAssembly(new FlowableSamplePublisher<T>(this, sampler, emitLast));
Expand Down Expand Up @@ -12755,37 +12758,6 @@ public final Flowable<T> startWithArray(T... items) {
return concatArray(fromArray, this);
}

/**
* Ensures that the event flow between the upstream and downstream follow
* the Reactive-Streams 1.0 specification by honoring the 3 additional rules
* (which are omitted in standard operators due to performance reasons).
* <ul>
* <li>§1.3: onNext should not be called concurrently until onSubscribe returns</li>
* <li>§2.3: onError or onComplete must not call cancel</li>
* <li>§3.9: negative requests should emit an onError(IllegalArgumentException)</li>
* </ul>
* In addition, if rule §2.12 (onSubscribe must be called at most once) is violated,
* the sequence is cancelled an onError(IllegalStateException) is emitted.
* <dl>
* <dt><b>Backpressure:</b></dt>
* <dd>The operator doesn't interfere with backpressure which is determined by the source {@code Publisher}'s backpressure
* behavior.</dd>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code strict} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* @return the new Flowable instance
* @since 2.0.5 - experimental
* @deprecated 2.0.7, will be removed in 2.1.0; by default, the Publisher interface is always strict
*/
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport(SchedulerSupport.NONE)
@Experimental
@CheckReturnValue
@Deprecated
public final Flowable<T> strict() {
return this;
}

/**
* Subscribes to a Publisher and ignores {@code onNext} and {@code onComplete} emissions.
* <p>
Expand Down Expand Up @@ -12997,12 +12969,13 @@ public final void subscribe(Subscriber<? super T> s) {
* <dt><b>Scheduler:</b></dt>
* <dd>{@code subscribe} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* <p>History: 2.0.7 - experimental
* @param s the FlowableSubscriber that will consume signals from this Flowable
* @since 2.0.7 - experimental
* @since 2.1 - beta
*/
@BackpressureSupport(BackpressureKind.SPECIAL)
@SchedulerSupport(SchedulerSupport.NONE)
@Experimental
@Beta
public final void subscribe(FlowableSubscriber<? super T> s) {
ObjectHelper.requireNonNull(s, "s is null");
try {
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/io/reactivex/FlowableSubscriber.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
* Represents a Reactive-Streams inspired Subscriber that is RxJava 2 only
* and weakens rules §1.3 and §3.9 of the specification for gaining performance.
*
* <p>History: 2.0.7 - experimental
* @param <T> the value type
* @since 2.0.7 - experimental
* @since 2.1 - beta
*/
@Experimental
@Beta
public interface FlowableSubscriber<T> extends Subscriber<T> {

/**
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/io/reactivex/Maybe.java
Original file line number Diff line number Diff line change
Expand Up @@ -2375,13 +2375,13 @@ public final Maybe<T> delaySubscription(long delay, TimeUnit unit, Scheduler sch
* <dt><b>Scheduler:</b></dt>
* <dd>{@code doAfterSuccess} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* <p>History: 2.0.1 - experimental
* @param onAfterSuccess the Consumer that will be called after emitting an item from upstream to the downstream
* @return the new Maybe instance
* @since 2.0.1 - experimental
* @since 2.1
*/
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@Experimental
public final Maybe<T> doAfterSuccess(Consumer<? super T> onAfterSuccess) {
ObjectHelper.requireNonNull(onAfterSuccess, "doAfterSuccess is null");
return RxJavaPlugins.onAssembly(new MaybeDoAfterSuccess<T>(this, onAfterSuccess));
Expand Down Expand Up @@ -2428,13 +2428,13 @@ public final Maybe<T> doAfterTerminate(Action onAfterTerminate) {
* <dt><b>Scheduler:</b></dt>
* <dd>{@code doFinally} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* <p>History: 2.0.1 - experimental
* @param onFinally the action called when this Maybe terminates or gets cancelled
* @return the new Maybe instance
* @since 2.0.1 - experimental
* @since 2.1
*/
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@Experimental
public final Maybe<T> doFinally(Action onFinally) {
ObjectHelper.requireNonNull(onFinally, "onFinally is null");
return RxJavaPlugins.onAssembly(new MaybeDoFinally<T>(this, onFinally));
Expand Down Expand Up @@ -2829,17 +2829,17 @@ public final <R> Single<R> flatMapSingle(final Function<? super T, ? extends Sin
* <dd>{@code flatMapSingleElement} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
*
* <p>History: 2.0.2 - experimental
* @param <R> the result value type
* @param mapper
* a function that, when applied to the item emitted by the source Maybe, returns a
* Single
* @return the new Maybe instance
* @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
* @since 2.0.2 - experimental
* @since 2.1
*/
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@Experimental
public final <R> Maybe<R> flatMapSingleElement(final Function<? super T, ? extends SingleSource<? extends R>> mapper) {
ObjectHelper.requireNonNull(mapper, "mapper is null");
return RxJavaPlugins.onAssembly(new MaybeFlatMapSingleElement<T, R>(this, mapper));
Expand Down
Loading

0 comments on commit 2d20a17

Please sign in to comment.