File tree Expand file tree Collapse file tree 3 files changed +52
-1
lines changed
rxjava-core/src/main/java/rx Expand file tree Collapse file tree 3 files changed +52
-1
lines changed Original file line number Diff line number Diff line change @@ -4911,10 +4911,22 @@ public final Boolean call(T t) {
4911
4911
}).cast (klass );
4912
4912
}
4913
4913
4914
+ /**
4915
+ * Instructs an Observable that is emitting items faster than its observer can consume them to buffer these
4916
+ * items indefinitely until they can be emitted.
4917
+ *
4918
+ * @return
4919
+ * @since 0.20
4920
+ */
4914
4921
public final Observable <T > onBackpressureBuffer () {
4915
4922
return lift (new OperatorOnBackpressureBuffer <T >());
4916
4923
}
4917
-
4924
+
4925
+ /**
4926
+ * @warn javadoc missing
4927
+ * @return
4928
+ * @since 0.20
4929
+ */
4918
4930
public final Observable <T > onBackpressureDrop () {
4919
4931
return lift (new OperatorOnBackpressureDrop <T >());
4920
4932
}
Original file line number Diff line number Diff line change 15
15
*/
16
16
package rx ;
17
17
18
+ /**
19
+ * @warn javadoc description missing
20
+ * @since 0.20
21
+ */
18
22
public interface Producer {
19
23
24
+ /**
25
+ * Request a certain maximum number of items from this Producer. This is a way of requesting backpressure.
26
+ * To disable backpressure, pass {@code Long.MAX_VALUE} to this method.
27
+ *
28
+ * @param n the maximum number of items you want this Producer to produce, or {@code Long.MAX_VALUE} if you
29
+ * want the Producer to produce items at its own pace
30
+ * @since 0.20
31
+ */
20
32
public void request (long n );
21
33
22
34
}
Original file line number Diff line number Diff line change @@ -83,10 +83,26 @@ public final boolean isUnsubscribed() {
83
83
return cs .isUnsubscribed ();
84
84
}
85
85
86
+ /**
87
+ * This method is invoked when the Subscriber and Observable have been connected but the Observable has
88
+ * not yet begun to emit items or send notifications to the Subscriber. Override this method to add any
89
+ * useful initialization to your subscription, for instance to initiate backpressure.
90
+ *
91
+ * @since 0.20
92
+ */
86
93
public void onStart () {
87
94
// do nothing by default
88
95
}
89
96
97
+ /**
98
+ * Request a certain maximum number of emitted items from the Observable this Subscriber is subscribed to.
99
+ * This is a way of requesting backpressure. To disable backpressure, pass {@code Long.MAX_VALUE} to this
100
+ * method.
101
+ *
102
+ * @param n the maximum number of items you want the Observable to emit to the Subscriber at this time, or
103
+ * {@code Long.MAX_VALUE} if you want the Observable to emit items at its own pace
104
+ * @since 0.20
105
+ */
90
106
public final void request (long n ) {
91
107
Producer shouldRequest = null ;
92
108
synchronized (this ) {
@@ -102,10 +118,21 @@ public final void request(long n) {
102
118
}
103
119
}
104
120
121
+ /**
122
+ * @warn javadoc description missing
123
+ * @return
124
+ * @since 0.20
125
+ */
105
126
protected Producer onSetProducer (Producer producer ) {
106
127
return producer ;
107
128
}
108
129
130
+ /**
131
+ * @warn javadoc description missing
132
+ * @warn param producer not described
133
+ * @param producer
134
+ * @since 0.20
135
+ */
109
136
public final void setProducer (Producer producer ) {
110
137
producer = onSetProducer (producer );
111
138
long toRequest ;
You can’t perform that action at this time.
0 commit comments