Skip to content

Commit bb89744

Browse files
committed
Add links to page that explains The Observable Contract
1 parent 1bb9cba commit bb89744

File tree

6 files changed

+17
-12
lines changed

6 files changed

+17
-12
lines changed

src/main/java/rx/Observable.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6830,8 +6830,8 @@ public final <R> Observable<R> scan(R initialValue, Func2<R, ? super T, R> accum
68306830
}
68316831

68326832
/**
6833-
* Forces an Observable's emissions and notifications to be serialized and for it to obey the Rx contract
6834-
* in other ways.
6833+
* Forces an Observable's emissions and notifications to be serialized and for it to obey
6834+
* <a href="http://reactivex.io/documentation/contract.html">the Observable contract</a> in other ways.
68356835
* <p>
68366836
* It is possible for an Observable to invoke its Subscribers' methods asynchronously, perhaps from
68376837
* different threads. This could make such an Observable poorly-behaved, in that it might try to invoke
@@ -7672,7 +7672,9 @@ public void onNext(T t) {
76727672
* error handling, unsubscribe, or execution hooks.
76737673
* <p>
76747674
* Use this only for implementing an {@link Operator} that requires nested subscriptions. For other
7675-
* purposes, use {@link #subscribe(Subscriber)} which ensures the Rx contract and other functionality.
7675+
* purposes, use {@link #subscribe(Subscriber)} which ensures
7676+
* <a href="http://reactivex.io/documentation/contract.html">the Observable contract</a> and other
7677+
* functionality.
76767678
* <dl>
76777679
* <dt><b>Scheduler:</b></dt>
76787680
* <dd>{@code unsafeSubscribe} does not operate by default on a particular {@link Scheduler}.</dd>

src/main/java/rx/internal/util/RxRingBuffer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
import rx.internal.util.unsafe.UnsafeAccess;
2727

2828
/**
29-
* This assumes Spsc or Spmc usage. This means only a single producer calling the on* methods. This is the Rx contract of an Observer.
30-
* Concurrent invocations of on* methods will not be thread-safe.
29+
* This assumes Spsc or Spmc usage. This means only a single producer calling the on* methods. This is the Rx
30+
* contract of an Observer (see http://reactivex.io/documentation/contract.html). Concurrent invocations of
31+
* on* methods will not be thread-safe.
3132
*/
3233
public class RxRingBuffer implements Subscription {
3334

src/main/java/rx/observables/BlockingObservable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public void forEach(final Action1<? super T> onNext) {
9696

9797
/*
9898
* Use 'subscribe' instead of 'unsafeSubscribe' for Rx contract behavior
99-
* as this is the final subscribe in the chain.
99+
* (see http://reactivex.io/documentation/contract.html) as this is the final subscribe in the chain.
100100
*/
101101
Subscription subscription = o.subscribe(new Subscriber<T>() {
102102
@Override

src/main/java/rx/observers/SafeSubscriber.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
/**
2828
* {@code SafeSubscriber} is a wrapper around {@code Subscriber} that ensures that the {@code Subscriber}
29-
* complies with the Rx contract.
29+
* complies with <a href="http://reactivex.io/documentation/contract.html">the Observable contract</a>.
3030
* <p>
3131
* The following is taken from <a href="http://go.microsoft.com/fwlink/?LinkID=205219">the Rx Design Guidelines
3232
* document</a>:

src/main/java/rx/subjects/SerializedSubject.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
* <p>
2525
* When you use an ordinary {@link Subject} as a {@link Subscriber}, you must take care not to call its
2626
* {@link Subscriber#onNext} method (or its other {@code on} methods) from multiple threads, as this could lead
27-
* to non-serialized calls, which violates the Observable contract and creates an ambiguity in the resulting
28-
* Subject.
27+
* to non-serialized calls, which violates <a href="http://reactivex.io/documentation/contract.html">the
28+
* Observable contract</a> and creates an ambiguity in the resulting Subject.
2929
* <p>
3030
* To protect a {@code Subject} from this danger, you can convert it into a {@code SerializedSubject} with code
3131
* like the following:

src/main/java/rx/subjects/Subject.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ protected Subject(OnSubscribe<R> onSubscribe) {
4040
* <p>
4141
* When you use an ordinary {@link Subject} as a {@link Subscriber}, you must take care not to call its
4242
* {@link Subscriber#onNext} method (or its other {@code on} methods) from multiple threads, as this could
43-
* lead to non-serialized calls, which violates the Observable contract and creates an ambiguity in the resulting Subject.
43+
* lead to non-serialized calls, which violates
44+
* <a href="http://reactivex.io/documentation/contract.html">the Observable contract</a> and creates an
45+
* ambiguity in the resulting Subject.
4446
* <p>
45-
* To protect a {@code Subject} from this danger, you can convert it into a {@code SerializedSubject} with code
46-
* like the following:
47+
* To protect a {@code Subject} from this danger, you can convert it into a {@code SerializedSubject} with
48+
* code like the following:
4749
* <p><pre>{@code
4850
* mySafeSubject = myUnsafeSubject.toSerialized();
4951
* }</pre>

0 commit comments

Comments
 (0)